<%@ page language="java" session="true" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:include page="../framework/header.jsp" />
<link href="${pageContext.request.contextPath}/static/plugin/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/gray.css" />
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/home0.css" />

<style>
	.panel-c1:hover {
	color:#348fe3!important;
	}

 	#mainnav-menu ul a, .menu-popover .sub-menu ul a:hover{
 	background-color:inherit;
 	}


	.bootstrap-table .table {

    background-color: #fff;
}

.fixed-table-container .fixed-table-body {
   height: 300px;
    overflow-y: scroll;
    overflow-x: hidden;
}
.fixed-table-container tbody td .th-inner, .fixed-table-container thead th .th-inner {
    font-size: 11px;
}
#container .table td {
    font-size: 10px;
}

</style>
<div id="container" class="effect aside-float aside-bright mainnav-lg navbar-fixed mainnav-fixed aside-fixed">
	<jsp:include page="../framework/topper.jsp" />
	<div class="boxed">
		<!--=======================  页面主体内容  ============================-->
		<div id="content-container">
			<!-- ============================  页面内容区  ================================== -->
			<div id="page-content">
					<div class="row">
	<div class="col-sm-3">
		<div class="panel panel-default panel-10  clickJump">
			<div class="panel-body  panel-a">
				<span class="a-word">项目</span>
					<span class="a-num" ><input id="projectCount"  value="0" readOnly="true"></span>
				<span><img alt="image" class="img-a" src="static/images/service.png"/></span>
			</div>
			<div class="panel-footer panel-b0"><span>所属项目</span></div>
		</div>
	</div>
	<div class="col-sm-3">
		<div class="panel panel-default panel-11 clickJump">
			<div class="panel-body  panel-a">
				<span class="a-word">套件</span>
				<span class="a-num" ><input id="suiteCount"  value="0" readOnly="true"></span>
				<span><img alt="image" class="img-a" src="static/images/now1.png"/></span>
			</div>
			<div class="panel-footer panel-b1"><span>所属项目下的所有套件</span></div>
		</div>
	</div>
	<div class="col-sm-3">
		<div class="panel panel-default panel-12 clickJump">
			<div class="panel-body  panel-a">
				<span class="a-word">任务</span>
				<span class="a-num" ><input id="taskCount"  value="0" readOnly="true"></span>
				<span><img alt="image" class="img-a" src="static/images/qps.png"/></span>
			</div>
			<div class="panel-footer panel-b2"><span>所有套件下的所有任务</span></div>
		</div>
	</div>
	<div class="col-sm-3">
		<div class="panel panel-default panel-13 clickJump">
			<div class="panel-body  panel-a">
				<span class="a-word">执行成功数/总数（个）</span>
				<span class="a-num" ><input id="resultCount"  value="0" readOnly="true"></span>
				<span><img alt="image" class="img-a" src="static/images/number1.png"/></span>
			</div>
			<div class="panel-footer panel-b3"><span>套件的执行成功数</span></div>
		</div>
	</div>

</div>

<div class="row">
<div class="col-sm-3">

				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">
				            快捷方式
				        </h3>
					</div>
					<div class="panel-body panel-b" style="text-align: center;">
						<div class="row panel-body-b1">
							<div class="col-sm-4 panel-c1 panel-c10" >
								<dt><img alt="image" class="img-c" src="static/images/ceshiyongli.png" /></dt>
								<h5>测试用例</h5>
							</div>
							<div class="col-sm-4 panel-c1 panel-c11">
								<dt><img alt="image" class="img-c" src="static/images/xiangmuguanli.png" /></dt>
								<h5>项目管理</h5>
							</div>
							<div class="col-sm-4 panel-c1 panel-c12" >
								<dt><img alt="image" class="img-c" src="static/images/taojianguanli.png" /></dt>
								<h5>套件管理</h5>
							</div>
						</div>

						<div class="row panel-body-b1">
							<div class="col-sm-4 panel-c1 panel-c20" >
								<dt><img alt="image" class="img-c" src="static/images/jingtaifenxi.png" /></dt>
								<h5>静态分析</h5>
							</div>
							<div class="col-sm-4 panel-c1 panel-c21" >
								<dt><img alt="image" class="img-c" src="static/images/jiekouzhushou.png" /></dt>
								<h5>接口测试</h5>
							</div>
							<div class="col-sm-4 panel-c1 panel-c22" >
								<dt><img alt="image" class="img-c" src="static/images/gongnengzhushou.png" /></dt>
								<h5>功能测试</h5>
							</div>
						</div>

						<div class="row panel-body-b1">
							<div class="col-sm-4 panel-c1 panel-c30" >
								<dt><img alt="image" class="img-c" src="static/images/JMeterTest.png" /></dt>
								<h5>Jmeter测试</h5>
							</div>

							<div class="col-sm-4 panel-c1 panel-c31" >
								<dt><img alt="image" class="img-c" src="static/images/ceshiziyuan.png" /></dt>
								<h5>测试资源</h5>
							</div>
						</div>
					</div>
				</div>



		<c:choose>
		   <c:when test="${fn:contains(urlSet, ',home/getMonitorData,')}">
		   		<div class="panel panel-default panel-e">
					<div class="panel-heading panel-head0-c">
						<h3 class="panel-title panel-title0-c">
							系统服务器资源
						</h3>
					</div>
					<div class="panel-body panel-body-e"  id="ipMonitor"></div>
			</div>
		   </c:when>

		   <c:otherwise>
		   		<div class="panel panel-default project_pie_wrap_e panel_main3">
			<div class="panel-heading panel-head0-c">
				<h3 class="panel-title panel-title0-c">
				<span class="nameType" ></span>
				</h3>
					<a class="pull-right" data-toggle="modal" data-target="#exampleModal" data-whatever="main4">
                        <i class="glyphicon glyphicon-asterisk glyphicon-a" ></i>
                    </a>
			</div>
			<div class="panel-body panel-b">
				<div class="project-timeRange-wrap"><span class="project-timeRange" ></span><span class="projectId hidden" ></span></div>
				<div class="main03 hidden" >无数据</div>
				<div id="main3" ></div>
				<div class="row taskType hidden">
					<div class="col-xs-1"></div>
					<div class="col-xs-2 panel-b4 ">
						<div>静态分析</div>
						<h5><span class="jingtai" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>接口测试</div>
						<h5><span class="jiekou" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>功能测试</div>
						<h5><span class="gongneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>性能分析</div>
						<h5><span class="xingneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>其他</div>
						<h5><span class="qita" ></span></h5>
					</div>
<!-- 					<div class="col-lg-1"></div> -->
				</div>
				<div class="row taskExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="taskExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="taskExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row suiteExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="suiteExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="suiteExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row testCaseState hidden">
<!-- 					<div class="col-xs-4 panel-b4"> -->
<!-- 						<div>未运行</div> -->
<!-- 						<h5><span class="testCaseState-noRun" ></span></h5> -->
<!-- 					</div> -->

				</div>
				<div class="row bugState hidden">
					<div class="col-xs-4 panel-b4">
						<div>新建</div>
						<h5><span class="bugState-create" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>进行中</div>
						<h5><span class="bugState-on" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>已关闭</div>
						<h5><span class="bugState-off" ></span></h5>
					</div>
				</div>
			</div>
		</div>
		   </c:otherwise>
		</c:choose>


</div>
<div class="col-sm-9">
		<div class="row">

			<div class="col-sm-12">
				<div class="panel panel-default">
					<div class="panel-heading panel-head0-c" >
						<h3 class="panel-title panel-title0-c">
							套件执行情况
						</h3>
						<a class="pull-right"  id="refresh"><i class="fa fa-refresh glyphicon-a" ></i></a>
					</div>
					<div class="panel-body panel-b  panel-bb" >
<!-- 						<table id = "testTable" ></table> -->
						<table id="testTable" class="table" >
<!--                                   <thead> -->
<!-- 							        <tr> -->
<!-- 							            <th data-field="state" data-checkbox="true"></th> -->
<!-- 							            <th data-field="projectName">项目名称</th> -->
<!-- 							            <th data-field="suiteName" >套件名称</th> -->
<!-- 							            <th data-field="executeResult" data-formatter="executeResultFun">执行结果</th> -->
<!-- 							            <th data-field="executeEndTime" data-formatter="executeEndTimeFun">完成时间</th> -->
<!-- 							            <th data-field="execUserName" data-formatter="execUserNameFun">执行方式</th> -->
<!-- 							        </tr> -->
<!-- 							    </thead> -->
							    <thead>
								        <tr>
								            <th data-field="state" data-checkbox="true"></th>
								            <th data-field="id"  data-formatter="invoiceFormatter">Item ID</th>
								            <th data-field="name" >Item Name</th>
								            <th data-field="price" >Item Price</th>
								            <th data-align="center" data-width="140" data-formatter="pref_btns">操作</th>
								        </tr>
								    </thead>
                      </table>
					</div>
				</div>
			</div>
		</div>
<div class="row">
	<div class="col-sm-4">
		<div class="panel panel-default project_pie_wrap panel_main">
			<div class="panel-heading panel-head0-c">
				<h3 class="panel-title panel-title0-c">
				<span class="nameType" ></span>
				</h3>
					<a class="pull-right" data-toggle="modal" data-target="#exampleModal" data-whatever="main1">
                        <i class="glyphicon glyphicon-asterisk glyphicon-a" ></i>
                    </a>
			</div>
			<div class="panel-body panel-b">
				<div class="project-timeRange-wrap"><span class="project-timeRange" ></span><span class="projectId hidden" ></span></div>
				<div class="main00 hidden" >无数据</div>
				<div id="main" ></div>
				<div class="row taskType hidden">
					<div class="col-xs-1"></div>
					<div class="col-xs-2 panel-b4 ">
						<div>静态分析</div>
						<h5><span class="jingtai" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>接口测试</div>
						<h5><span class="jiekou" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>功能测试</div>
						<h5><span class="gongneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>性能分析</div>
						<h5><span class="xingneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>其他</div>
						<h5><span class="qita" ></span></h5>
					</div>
<!-- 					<div class="col-lg-1"></div> -->
				</div>
				<div class="row taskExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="taskExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="taskExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row suiteExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="suiteExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="suiteExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row testCaseState hidden">
<!-- 					<div class="col-sm-1  panel-b4 cm8" > -->
<!-- 						<div>未运行</div> -->
<!-- 						<h5><span class="testCaseState-noRun" ></span></h5> -->
<!-- 					</div> -->
				</div>
				<div class="row bugState hidden">
					<div class="col-xs-4 panel-b4">
						<div>新建</div>
						<h5><span class="bugState-create" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>进行中</div>
						<h5><span class="bugState-on" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>已关闭</div>
						<h5><span class="bugState-off" ></span></h5>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-sm-4">
		<div class="panel panel-default project_pie_wrap panel_main1">
			<div class="panel-heading panel-head0-c">
				<h3 class="panel-title panel-title0-c">
				<span class="nameType" ></span>
				</h3>
				<a class="pull-right" data-toggle="modal" data-target="#exampleModal" data-whatever="main2">
                        <i class="glyphicon glyphicon-asterisk glyphicon-a" ></i>
                </a>
			</div>
			<div class="panel-body panel-b">
				<div class="project-timeRange-wrap"><span class="project-timeRange" ></span><span class="projectId hidden" ></span></div>
				<div class="main01 hidden" >无数据</div>
				<div id="main1"></div>
				<div class="row taskType hidden">
					<div class="col-xs-1"></div>
					<div class="col-xs-2 panel-b4 ">
						<div>静态分析</div>
						<h5><span class="jingtai" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>接口测试</div>
						<h5><span class="jiekou" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>功能测试</div>
						<h5><span class="gongneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>性能分析</div>
						<h5><span class="xingneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>其他</div>
						<h5><span class="qita" ></span></h5>
					</div>
<!-- 					<div class="col-lg-1"></div> -->
				</div>
				<div class="row taskExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="taskExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="taskExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row suiteExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="suiteExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="suiteExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row testCaseState hidden">
<!-- 					<div class="col-xs-4 panel-b4"> -->
<!-- 						<div>未运行</div> -->
<!-- 						<h5><span class="testCaseState-noRun" ></span></h5> -->
<!-- 					</div> -->
				</div>
				<div class="row bugState hidden">
					<div class="col-xs-4 panel-b4">
						<div>新建</div>
						<h5><span class="bugState-create" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>进行中</div>
						<h5><span class="bugState-on" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>已关闭</div>
						<h5><span class="bugState-off" ></span></h5>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-sm-4">
		<div class="panel panel-default project_pie_wrap panel_main2">
			<div class="panel-heading panel-head0-c">
				<h3 class="panel-title panel-title0-c">
				<span class="nameType" ></span>
				</h3>
				<a class="pull-right" data-toggle="modal" data-target="#exampleModal" data-whatever="main3">
                        <i class="glyphicon glyphicon-asterisk glyphicon-a" ></i>
                </a>
			</div>
			<div class="panel-body panel-b">
				<div class="project-timeRange-wrap"><span class="project-timeRange" ></span><span class="projectId hidden" ></span></div>
				<div class="main02 hidden" >无数据</div>
				<div id="main2" ></div>
				<div class="row taskType hidden">
					<div class="col-xs-1"></div>
					<div class="col-xs-2 panel-b4 ">
						<div>静态分析</div>
						<h5><span class="jingtai" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>接口测试</div>
						<h5><span class="jiekou" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>功能测试</div>
						<h5><span class="gongneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>性能分析</div>
						<h5><span class="xingneng" ></span></h5>
					</div>
					<div class="col-xs-2 panel-b4">
						<div>其他</div>
						<h5><span class="qita" ></span></h5>
					</div>
<!-- 					<div class="col-lg-1"></div> -->
				</div>
				<div class="row taskExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="taskExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="taskExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row suiteExecute hidden">
					<div class="col-xs-6 panel-b4">
						<div>通过</div>
						<h5><span class="suiteExecute-success" ></span></h5>
					</div>
					<div class="col-xs-6 panel-b4">
						<div>失败</div>
						<h5><span class="suiteExecute-fail" ></span></h5>
					</div>
				</div>
				<div class="row testCaseState hidden">
<!-- 					<div class="col-xs-4 panel-b4"> -->
<!-- 						<div>未运行</div> -->
<!-- 						<h5><span class="testCaseState-noRun" ></span></h5> -->
<!-- 					</div> -->

				</div>
				<div class="row bugState hidden">
					<div class="col-xs-4 panel-b4">
						<div>新建</div>
						<h5><span class="bugState-create" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>进行中</div>
						<h5><span class="bugState-on" ></span></h5>
					</div>
					<div class="col-xs-4 panel-b4">
						<div>已关闭</div>
						<h5><span class="bugState-off" ></span></h5>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</div>

</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="exampleModalLabel">New message</h4>
      </div>
      <div class="modal-body">
        <form class="form-horizontal" style="padding-left:30px;">
        <input type = "text" hidden = "true" name = "flag" id = "flag" >
          <div class="form-group">
              <label for="accountId" class="col-sm-2 col-xs-2 control-label">项目：</label>
              <div class="col-sm-9 col-xs-9" >
                  <select class="form-control projectselect "id="project" >
					  <c:forEach items="${projectList}" var="projectList">
                          <option value="${projectList.projectId}">${projectList.projectName}</option>
                      </c:forEach>
				</select>
              </div>
          </div>
          <div class="form-group">
              <label for="accountId" class="col-sm-2 col-xs-2 control-label">类型：</label>
              <div class="col-sm-9 col-xs-9" >
                  <select class="form-control" id="nameType">
					  <option value="0">任务类型比例</option>
					  <option value="1">任务执行结果</option>
					  <option value="2">套件执行结果</option>
					  <option value="3">测试用例状态</option>
					  <option value="4">测试用例情况</option>
					  <option value="5">缺陷状态</option>
					  <option value="6">缺陷情况</option>
				</select>
              </div>
          </div>
          <div class="form-group">
              <label for="accountId" class="col-sm-2 col-xs-2 control-label">时间范围：</label>
              <div class="col-sm-9 col-xs-9" >
                  <select class="form-control" id="timeRange" data-dropup-auto="false">
                  	  <option value="">全部</option>
					  <option value="0">过去一周</option>
					  <option value="1">过去两周</option>
					  <option value="2">过去一个月</option>
					  <option value="3">过去一年</option>
				</select>
              </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
      	<button type="button" class="btn btn-primary"  data-dismiss="modal" onclick="save();">确定</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
      </div>
    </div>
  </div>
</div>


			</div>
		</div>

		<!--=========================  过程可视化消息栏  ==========================-->
		<jsp:include page="../framework/aside.jsp" />

		<!--=========================  左侧菜单  ==========================-->
		<jsp:include page="../framework/lefter.jsp" />

	</div>

	<!--=========================  页面底部版权信息  ==========================-->
	<jsp:include page="../framework/footer.jsp" />

	<!--=========================  返回顶层按钮  ==========================-->
	<button class="scroll-top btn">
		<i class="pci-chevron chevron-up"></i>
	</button>
	<!--=========================  选择皮肤功能  ==========================-->
	<jsp:include page="../framework/page-set.jsp" />

	<div id="floating-top-right" class="floating-container"></div>
</div>
<!--===================================================-->
<!-- END OF CONTAINER -->

<jsp:include page="../framework/script.jsp" />
<script src="${pageContext.request.contextPath}/static/plugin/bootstrap-table/bootstrap-table.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
 <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/common/echarts.js"></script>
<script type="text/javascript">
//回车事件
document.onkeydown = function () {
		if (window.event && window.event.keyCode == 13) {
			save();
			$('#exampleModal').modal('hide');
		}
	}
//loadding
var ipMonitorLoadding = "";
 if("${fn:contains(urlSet, ',home/getMonitorData,')}" == "true"){
	  ipMonitorLoadding = echarts.init(document.getElementById('ipMonitor'));
}

//第二部分：快捷方式的跳转链接
$(".panel-10").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'project/project', '项目配置');
	});
$(".panel-11").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'testPanel', '套件管理');
	});
$(".panel-12").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'testPanel', '套件管理');
	});
// $(".panel-13").click(function(){
//	 addNewTabs(parent.$('.mainTabs'), 'testReport', '执行报告');
//	});

//$(".panel-13").click(function(){
//	 addNewTabs(parent.$('.mainTabs'), 'jsplumb-draggable', '拖拽测试');
//	});

$(".panel-13").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'assemblyLine', '流水线测试');
	});

$(".panel-c10").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'testCase/testCase', '测试用例');
	});
$(".panel-c11").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'project/project', '项目配置');
	});
$(".panel-c12").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'testPanel', '套件管理');
	});

$(".panel-c20").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'manual/sonar', '静态分析');
	});
$(".panel-c21").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'testIntfc/toTestIntfc', '接口测试');
	});
$(".panel-c22").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'webTestProcedure/toWebTestProcedure', '功能测试');
	});

$(".panel-c30").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'Jmeter/Jmeter', 'Jmeter测试');
	});
$(".panel-c31").click(function(){
	 addNewTabs(parent.$('.mainTabs'), 'resource/testResource', '测试资源');
	});

//服务器监控的跳转链接
$(document).on('click','.panel-e01',function(){
	 var resourceIP = $(this).find('h4').text();
	 addNewTabs(parent.$('.mainTabs'), 'home/ipMonitor?ip='+resourceIP, '资源监控',1);
//	 var station = $(this).find('.station').text();
//	 addNewTabs(parent.$('.mainTabs'), 'home/ipMonitor?ip='+resourceIP+'&station='+station,resourceIP + '资源监控');
});



<%--  var userType = <%=session.getAttribute("userType")%>== null ? 2 :<%=session.getAttribute("userType")%>; --%>


$("#main").click(function(){
//	alert(111);
	var nameType = $(".panel_main").find('.nameType').text();
	var projectAndTimeRange = $(".panel_main").find('.project-timeRange').text();
	var projectId = $(".panel_main").find('.projectId').text();

	var str = projectAndTimeRange.split('-');
	var projectName = str[0];
//	$("#projectCount").val(str[0]);

//	 console.log(nameType);
//	 console.log(projectAndTimeRange);
//	 console.log(projectId);
	 if(nameType == '缺陷状态' || nameType == '缺陷情况'){
		 addNewTabs(parent.$('.mainTabs'), 'home/bugCondition?projectId='+projectId, projectName + '缺陷');

	 }else if(nameType == '测试用例状态' || nameType == '测试用例情况'){

		 addNewTabs(parent.$('.mainTabs'), 'home/testCaseCondition?projectId='+projectId, projectName + '测试用例');
	 }

	});

$("#main1").click(function(){
//	alert(222);
	var nameType = $(".panel_main1").find('.nameType').text();
	var projectAndTimeRange = $(".panel_main1").find('.project-timeRange').text();
	var projectId = $(".panel_main1").find('.projectId').text();
	var str = projectAndTimeRange.split('-');
	var projectName = str[0];
//	 console.log(nameType);
//	 console.log(projectAndTimeRange);
	 if(nameType == '缺陷状态' || nameType == '缺陷情况'){
		 addNewTabs(parent.$('.mainTabs'), 'home/bugCondition?projectId='+projectId, projectName + '缺陷');

	 }else if(nameType == '测试用例状态' || nameType == '测试用例情况'){

		 addNewTabs(parent.$('.mainTabs'), 'home/testCaseCondition?projectId='+projectId, projectName + '测试用例');
	 }
	});

$("#main2").click(function(){
//	alert(333);
	var nameType = $(".panel_main2").find('.nameType').text();
	var projectAndTimeRange = $(".panel_main2").find('.project-timeRange').text();
	var projectId = $(".panel_main2").find('.projectId').text();
	var str = projectAndTimeRange.split('-');
	var projectName = str[0];
//	 console.log(nameType);
//	 console.log(projectAndTimeRange);
	 if(nameType == '缺陷状态' || nameType == '缺陷情况'){
		 addNewTabs(parent.$('.mainTabs'), 'home/bugCondition?projectId='+projectId, projectName + '缺陷');

	 }else if(nameType == '测试用例状态' || nameType == '测试用例情况'){

		 addNewTabs(parent.$('.mainTabs'), 'home/testCaseCondition?projectId='+projectId,projectName + '测试用例');
	 }
	});

$("#main3").click(function(){
//	alert(333);
	var nameType = $(".panel_main3").find('.nameType').text();
	var projectAndTimeRange = $(".panel_main3").find('.project-timeRange').text();
	var projectId = $(".panel_main3").find('.projectId').text();
	var str = projectAndTimeRange.split('-');
	var projectName = str[0];
//	 console.log(nameType);
//	 console.log(projectAndTimeRange);
	 if(nameType == '缺陷状态' || nameType == '缺陷情况'){
		 addNewTabs(parent.$('.mainTabs'), 'home/bugCondition?projectId='+projectId, projectName + '缺陷');

	 }else if(nameType == '测试用例状态' || nameType == '测试用例情况'){

		 addNewTabs(parent.$('.mainTabs'), 'home/testCaseCondition?projectId='+projectId,projectName + '测试用例');
	 }
	});

//$("#main1").click(function(){
//	alert(111);
//// 	 addNewTabs(parent.$('.mainTabs'), 'resource/testResource', '测试资源');
//	});

//初始化页面加载数据
$(function(){
	 getCounts();
	 getMonitorData();
		loadData();
		//初始化模态框
		$('#exampleModal').on('show.bs.modal', function (event) {
			$(".modal-header .modal-title").before("<i class='glyphicon glyphicon-th-large' ></i>");
			$(".modal-dialog").css("width","600");
	 			$(".modal-body").css("height","160px");
			$("ul.dropdown-menu.inner").css("max-height","200px");
			  var a = $(event.relatedTarget) // a that triggered the modal
			  var recipient = a.data('whatever') // Extract info from data-* attributes
			 $('#exampleModal').removeClass('main1 main2 main3').addClass(recipient);
			  var modal = $(this)
			  modal.find('.modal-title').text('自定义面板 ');
			  //设置三个模态框打开的标记
			  $("#flag").val(recipient);

			  //饼状图自定义配置回显
			  getMyTestProjectConfig(recipient,"1");
			})
			//加载页面时饼状图数据初始化
			getMyTestProjectConfig("","0");
//			getMonitorData();

});

//第一部分：项目，套件，任务，执行成功数的获取
var getCounts = function(){
	 $.ajax({
	        type : "post",
	        url : '${pageContext.request.contextPath}/home/getCounts.do',//找到controller里相应的方法
	        success : function(data) {
	        	var str = data.split(',');
	        	$("#projectCount").val(decodeURI(str[0]));
	        	$("#suiteCount").val(str[1]);
	        	$("#taskCount").val(str[2]);
	        	$("#resultCount").val(str[3]);
	        },
	        error : function(data) {
//	        	layer.alert('操作失败');
	        }
	       });
}

//第三部分：套件执行情况表格加载
function loadData(){
	$('#testTable').bootdatagrid(
			"${pageContext.request.contextPath}/name/aaaa/getTableData", {
				pagination : false,
				pageNumber : 1,
				pageSize : 10,
				dataType:'json',
// 				queryParams:function(params){
// 					var projectName ="";
// 					var suiteName = "";
// 					var executeResult = "4";
// 			    	var parm = {
// 			    			"pageIndex" : 0,
// 			    			"pageSize" : 500,
// 			    			"projectName" : projectName,
// 			    			"suiteName" : suiteName,
// 			    			"executeResult" : executeResult,
// 			    			"column" :  'executeEndTime' ,
// 			    			"order" : 'desc'
// 			    			};
// 			    	return parm;
// 			    },
				singleSelect : false,
				striped : true,
				clickToSelect : true
	});
// 	$('#testTable').bootdatagrid(
// 			"${pageContext.request.contextPath}/sysSuite/queryProjectSuiteResult.do", {
// 				pagination : true,
// 				pageNumber : 1,
// 				pageSize : 10,
// 				dataType:'json',
// 				queryParams:function(params){
// 					var projectName ="";
// 					var suiteName = "";
// 					var executeResult = "4";
// 			    	var parm = {
// 			    			"pageIndex" : 0,
// 			    			"pageSize" : 500,
// 			    			"projectName" : projectName,
// 			    			"suiteName" : suiteName,
// 			    			"executeResult" : executeResult,
// 			    			"column" :  'executeEndTime' ,
// 			    			"order" : 'desc'
// 			    			};
// 			    	return parm;
// 			    },
// 				singleSelect : false,
// 				striped : true,
// 				clickToSelect : true
// 	});


// 		$('#testTable').grid({
// 			idField : 'id',
// 			method : 'POST',
// //			pagination : true,// 显示分页控件
// 			singleSelect : true,
// 			striped : false,
// 			pageSize:500,
// 			columns: [
// 			            { field : 'projectName', title : '项目名称', sortable: true},
// 			            { field : 'suiteName', title : '套件名称', sortable: true},
// 			            { field : 'executeResult', title : '执行结果', sortable: true,
// 		            		formatter : function(value, row, index){
// 		            			if(0 == value) return "未开始 #"+row.executeNumber;
// 		            			else if(1 == value) return "执行中 #"+row.executeNumber;
// 		            				else if(2 == value) return "执行失败 #"+row.executeNumber;
// 		            					else if(3 == value) return "执行成功 #"+row.executeNumber;
// 		            					   else if(4 == value) return "执行失败-资源不足 #"+row.executeNumber;
// 		            					   		else if(5 == value) return "执行超时 #"+row.executeNumber;
// 		            								else if(6 == value) return "执行被中止 #"+row.executeNumber;
// 		            									else if(7 == value) return "执行未通过 #"+row.executeNumber;
// 		            			} },
// 			            { field : 'executeEndTime', title :  '完成时间', sortable: true,
// 			            	formatter : function(cellvalue,options,rowObject){
// 							if(cellvalue)
// 								return formatDateTime(cellvalue);
// 							} },
// 			            { field : 'execUserName', title : '执行方式', sortable: true,
// 								formatter : function(value, row, index){
// 									if(value == '' || value == null)
// 										return null;
// 									switch (row.executeMethod) {
// 										case 0 : return value+"（"+row.execUserAccount+"）"+"手工执行";break;
// 										case 1 : return value+"（"+row.execUserAccount+"）"+"定时自动执行";break;
// 										case 2 : return value+"（"+row.execUserAccount+"）"+"通过API执行";break;
// 										default: return value+"（"+row.execUserAccount+"）"+"执行";break;
// 									}
// 								} }

// 			        ],
// 			        onClickRow: function(row, tr){

// 			        	result(row);
// 			        },
// 			        onLoadSuccess:function(data){
// 			        	if(data.total == 0){
// 			        		$('.panel-bb').css("background-color","#fff");
// 			        		$('.fixed-table-body').css("height","0");
// 			        	}else{
// 			        		$('.panel-bb').css("background-color","#f0f8ff");
// 			        		$('.fixed-table-body').css("height","265px");
// 			        	}
// 			        }
// 		});
// 		gridLoad1('testTable','${pageContext.request.contextPath}/sysSuite/queryProjectSuiteResult.do', getParam());
	};
	function invoiceFormatter(value,row,index){
		return 'ID '+value;
	}
	function pref_btns(value,row,index){
// 		console.log(index);
		var btns = '';
		btns += '<a class="btn-table-cell" onclick="tablebtnclick(this);">删除</a>';
		btns += ' | <a class="btn-table-cell" onclick="tablebtnclick(this);">编辑</a>';
		btns += ' | <a class="btn-table-cell" data-toggle="tooltip" data-container="body" data-placement="top" title="日志日志">日志</a>';
		return btns;
	}
	$("#refresh").click(function(){
		gridLoad1('testTable','${pageContext.request.contextPath}/sysSuite/queryProjectSuiteResult.do', getParam());
	});
// 	window.setInterval(function(){
// 		gridLoad1('testTable','${pageContext.request.contextPath}/sysSuite/queryProjectSuiteResult.do', getParam());
// 	}, 600000);

// 	function getParam(){
// 		var projectName ="";
// 		var suiteName = "";
// 		var executeResult = "4";
// 		return {
// 			"pageIndex" : 0,
// 			"pageSize" : 500,
// 			"projectName" : projectName,
// 			"suiteName" : suiteName,
// 			"executeResult" : executeResult,
// 			"column" :  'executeEndTime' ,
// 			"order" : 'desc'
// 			};
// 	};

	//结果按钮
	function result(index){

			suiteId = $('#testTable').grid("getRow", index).suiteId;
			projectId = $('#testTable').grid("getRow", index).projectId;
			executeNumber = $('#testTable').grid("getRow", index).executeNumber;
			projectName = $('#testTable').grid("getRow", index).projectName;
			suiteName = $('#testTable').grid("getRow", index).suiteName;
			//将中文进行编码
			var encodingProjectName = encodeURI(encodeURI(projectName));
			var encodingSuiteName = encodeURI(encodeURI(suiteName));

		 	addNewTabs1(parent.$('.mainTabs'), "taskResult/report?suiteId="+suiteId+"&projectId="+projectId+"&executeNumber="
		 			+executeNumber+"&projectName="+encodingProjectName+"&suiteName="+encodingSuiteName, '测试结果');
	}

	//打开新的Tab页
	function addNewTabs1(target, url, title) {
	    var param = {};
	    param.closable = true;
	    param.title = title;
	    if (url != null && url != '') {
	            param.content = url;
	            target.tabs('remove', title);
	            target.tabs('add', param);
	            target.tabs('select', title);
	    }
	}

	//排序，重新加载
// 	$('#testTable').grid({
// 		onSortColumn: function (sort,order){
// 	 		function orderParam(){
// 	 			return {
// 	 					"pageIndex" : 0,
// 						"pageSize" : 500,
// 						"projectName" : "",
// 						"suiteName" : "",
// 						"executeResult" : "4",
// 	 					"column" : sort,
// 	 					"order" : order
// 	 				};
// 	 		};
// 	 		gridLoad1('testTable','${pageContext.request.contextPath}/sysSuite/queryProjectSuiteResult.do', orderParam());

// 	 		$(".coodo-grid-header-row .coodo-grid-header>.btn-group").addClass('hidden');
// 	 		$(".coodo-grid-panel .table .coodo-grid-header-row>td[field='"+sort+"'] .coodo-grid-header .btn-group").removeClass('hidden');

// 		}
// 	});

	//grid初始化加载数据公用调用方法
// 	var gridLoad1 = function(gridName,url,param){
// 		//初始化页面
// 		getGata1(gridName,url,$.extend(param, {
// 			pageIndex : param.pageIndex,
// 			pageSize : param.pageSize
// 		}), function(result) {
// 			$('#'+gridName).grid('loadData', result);
// 			$(pager).pagination('build', result.total);
// 			$('#'+gridName).closeMask();
// 		});
// 		//获取翻页 页数
// 		var pager = $('#'+gridName).grid('getPager');
// 		if (pager)
// 			$(pager).pagination('options').onSelectPage = function(pageNumber, pageSize) {
// 			getGata1(gridName,url,$.extend(param, {
// 					pageIndex : (pageNumber-1)*pageSize,
// 					pageSize : pageSize
// 				}), function(result) {
// 					$('#'+gridName).grid('loadData', result);
// 					$('#'+gridName).closeMask();
// 				});
// 			};
// 	};

	//通过后台url查询数据
// 	var getGata1 = function(gridName,url,param,successCallBack) {
// 		var newList;
// 		$('#'+gridName).openMask();
// 		$.ajax({
// 			type : 'POST',
// 			async : true,
// 			data : param,
// 			url : url,
// 			dataType : "json",
// 			contentType : "application/x-www-form-urlencoded;charset=utf-8",
// 			success : function(resultObj) {
// 				//转换数据格式
// 				newList = switchPageList(resultObj);
// 				//成功后返回新数据格式
// 				if (successCallBack)
// 					successCallBack(newList);

// 				//实现表格列可拖动
// //				$('#'+gridName).colResizable({
// //					liveDrag:true,
// //					gripInnerHtml:"<div class='grip'></div>",
// //					draggingClass:"dragging",
// //		            resizeMode:'fit'
// //		        });
// 			},
// 			error : function(responseObject) {
// //				var headerStatus = responseObject.status;
// //				if (headerStatus == 400) {
// //					var errorText = responseObject.responseText;
// //					layer.alert(errorText);
// //					var errorObj = eval("(" + errorText + ")");
// //					layer.alert(errorObj.message);
// //				}
// //				$('#'+gridName).closeMask();
// 			}

// 		});
// 		return newList;
// 	}

// 基于准备好的dom，初始化echarts实例

if("${fn:contains(urlSet, ',home/getMonitorData,')}" != "true"){
	 var myChart3 = echarts.init(document.getElementById('main3'));
}
var myChart = echarts.init(document.getElementById('main'));
var myChart1 = echarts.init(document.getElementById('main1'));
var myChart2 = echarts.init(document.getElementById('main2'));



//	 $(window).resize(function(){
//		 myChart.resize();
//		 myChart1.resize();
//		 myChart2.resize();
//	 });

//task类型比例图表的配置项和数据
var option00 = {
		color:['#81C2D6','#8192D6','#D9B3E6','#BFDBB8','#83FCD8'],

tooltip : {
 trigger: 'item',
 formatter: "{a} <br/>{b} : {c} ({d}%)"
},
calculable : true,
series : [
 {
     name:'task类型比例',
     type:'pie',
     radius: ['40%', '60%'],
     center: ['50%', '45%'],
     hoverAnimation:false,
     label: {
         normal: {
             show: true

         }

     },
     labelLine: {
         normal: {
             show: false,
             length:10,
			  length2:0
         }
     },
     data:[
         {value:0, name:'静态分析'},
         {value:0, name:'接口测试'},
         {value:0, name:'功能测试'},
         {value:0, name:'性能分析'},
		  {value:0, name:'其他'}

     ]
 }
]
};
//task执行情况图表的配置项和数据
var option01 = {
color:['#81C2D6','#8192D6'],
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
calculable : true,
series : [
{
    name:'task执行情况',
    type:'pie',
    radius: ['40%', '60%'],
    center: ['50%', '45%'],
    hoverAnimation:false,
    label: {
        normal: {
            show: true
        }
    },
    labelLine: {
        normal: {
            show: false,
            length:10,
			  length2:0
        }
    },
    data:[
        {value:0, name:'通过'},
        {value:0, name:'失败'}

    ]
}
]
};
//套件执行结果图表的配置项和数据
var option02 = {
		color:['#81C2D6','#8192D6'],
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
	    calculable : true,
	    series : [
	        {
	            name:'套件执行情况',
	            type:'pie',
	            radius: ['40%', '60%'],
	            center: ['50%', '45%'],
	            hoverAnimation:false,
	            label: {
	                normal: {
	                    show: true
	                }
	            },
	            labelLine: {
	                normal: {
	                    show: false,
	                    length:10,
	       			  length2:0
	                }
	            },
	            data:[
	                {value:0, name:'通过'},
	                {value:0, name:'失败'}
	            ]
	        }
	    ]
	};
//测试用例状态图表的配置项和数据
var option03 = {
		color:['#81C2D6','#8192D6','#D9B3E6','#BFDBB8','#83FCD8','#FFB8B8','#86E65A','#24D197'],
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
		series : [
	        {
	            name:'测试用例状态',
	            type:'pie',
	            radius: ['40%', '60%'],
	            center: ['50%', '45%'],
	            hoverAnimation:false,
	            label: {
	                normal: {
	                    show: true
	                }
	            },
	            labelLine: {
	                normal: {
	                    show: false,
	                    length:10,
	       			  length2:0
	                }
	            },
	            data:[
						{value:0, name:''},
						{value:0, name:''},
						{value:0, name:''},
						{value:0, name:''},
						{value:0, name:''},
						{value:0, name:''},
						{value:0, name:''},
						{value:0, name:''}
	            ]
	        }
	    ],
	};
//测试用例情况图表的配置项和数据
var option04 = {
		color:['#81C2D6'],
	tooltip: {
		trigger: 'axis'
	},
	legend: {
		 data:['数量'],
		 bottom:2
	},
	grid:{
			top:8,
			bottom:10,
			left:30,
			height:185
	},
		dataZoom: [
			{
//				startValue: dataTime[0],
				startValue: '',
				type: 'inside'
			}
		],
	xAxis:  {
		type: 'category',
		boundaryGap: false,
		axisLabel:{
			rotate:90,
			interval:0,
			showMinLabel:true,
			showMaxLabel:true
		},
		data: []
	},
	yAxis: {
		type: 'value',
		axisLabel: {
			formatter: '{value}'
		}
	},
	series: [{
		name:'数量',
		type:'line',
		symbolSize:1,
		showSymbol: false,
		data:[]
}
]
};
//缺陷状态图表的配置项和数据
var option05 = {
		color:['#81C2D6','#8192D6','#D9B3E6','#BFDBB8','#83FCD8','#FFB8B8','#86E65A','#24D197'],
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
		series : [
	        {
	            name:'缺陷状态',
	            type:'pie',
	            radius: ['40%', '60%'],
	            center: ['50%', '45%'],
	            hoverAnimation:false,
	            label: {
	                normal: {
	                    show: true
	                }
	            },
	            labelLine: {
	                normal: {
	                    show: false,
	                    length:10,
	       			  length2:0
	                }
	            },
	            data:[
					{value:0, name:''},
					{value:0, name:''},
					{value:0, name:''},
					{value:0, name:''},
					{value:0, name:''},
					{value:0, name:''},
					{value:0, name:''},
					{value:0, name:''}
           ]
	        }
	    ],
	};
//缺陷情况图表的配置项和数据
var option06 = {
		color:['#81C2D6','#8192D6','#D9B3E6','#BFDBB8','#83FCD8'],
		tooltip: {
			trigger: 'axis'
		},
		legend: {
			 data:['严重','高','中','低','空'],
			 bottom:2
		},
		grid:{
			top:8,
			bottom:10,
			left:30,
			height:185
		},
		dataZoom: [
			{startValue: '',
			type: 'inside'
			}
		],
		xAxis:  {
			type: 'category',
			boundaryGap: false,

			axisLabel:{
				rotate:90,
				interval:0,
				showMinLabel:true,
				showMaxLabel:true
			},
			data: []
		},
		yAxis: {
			type: 'value',
			axisLabel: {
				formatter: '{value}'
			}
		},
		series: [{
			name:'严重',
			type:'line',
			symbolSize:1,
			showSymbol: false,
			data:[]
	},
	{
		name:'高',
		type:'line',
		symbolSize:1,
		showSymbol: false,
		data:[]
	},
	{
		name:'中',
		type:'line',
		symbolSize:1,
		showSymbol: false,
		data:[]
	},
	{
		name:'低',
		type:'line',
		symbolSize:1,
		showSymbol: false,
		data:[]
	},
	{
		name:'空',
		type:'line',
		symbolSize:1,
		showSymbol: false,
		data:[]
	}
]
};


//自定义设置模态框结果按钮触发事件
 function save(){
	//获取模态框标记
	   var flag=$("#flag").val();
	//获取三个下拉框选中的值
	   var project = $('#project option:selected').attr('value');
		var nameType = $('#nameType option:selected').attr('value');
		var timeRange = $('#timeRange option:selected').attr('value');
		//初始化newChart
		var newChart = myChart;
		var idx = 0;
		var mainFlag = 0;
		if(flag == "main2"){
			newChart = myChart1;
			idx = 1;
			mainFlag = 1;
		}
		if(flag == "main3"){
			newChart = myChart2;
			idx = 2;
			mainFlag = 2;
		}
		if(flag == "main4"){
			newChart = myChart3;
			idx = -1;
			mainFlag = -1;
		}
		//将选中的项目名称设置为面板标题
		if(idx == -1){
			$('.project_pie_wrap_e .nameType').text($('#nameType option[value="'+nameType+'"]').text());
			 $('.project_pie_wrap_e .project-timeRange').text($('#project option[value="'+project+'"]').text()+"-"
					 +$('#timeRange option[value="'+timeRange+'"]').text());
			 $('.project_pie_wrap_e .projectId').text(project);
		}else{
			 $('.project_pie_wrap:eq('+idx+') .nameType').text($('#nameType option[value="'+nameType+'"]').text());
			 $('.project_pie_wrap:eq('+idx+') .project-timeRange').text($('#project option[value="'+project+'"]').text()+"-"
					 +$('#timeRange option[value="'+timeRange+'"]').text());
			 $('.project_pie_wrap:eq('+idx+') .projectId').text(project);
		}

	//通过判断“类型”下拉框选中的值，加载对应的饼状图
	if(nameType == "0"){
		 function f11(){
			 if(mainFlag == 0){
				 $('#main').css('height','200px');
			 }else if(mainFlag == -1){
				 $('#main3').css('height','200px');
			 }else{
				 $('#main' + mainFlag).css('height','200px');
			 }
			 newChart.clear();
			 newChart.setOption(option00);
//			 newChart.resize();
			 $(window).resize(newChart.resize);
		 }
		 if(timeRange == ""){
			 getSuiteCounts(project,"",f11,mainFlag);
		 }else{
			 getSuiteCounts(project,timeRange,f11,mainFlag);
		 }
		 if(idx == -1){
			 $('.project_pie_wrap_e .taskType').removeClass('hidden');
			 $('.project_pie_wrap_e .taskExecute').addClass('hidden');
			 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap_e .testCaseState').addClass('hidden');
			 $('.project_pie_wrap_e .bugState').addClass('hidden');
		 }else{
			 $('.project_pie_wrap:eq('+idx+') .taskType').removeClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .taskExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .testCaseState').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .bugState').addClass('hidden');
		 }
	 }else if(nameType == "1"){
		 function f12(){
			 if(mainFlag == 0){
				 $('#main').css('height','200px');
			 }else if(mainFlag == -1){
				 $('#main3').css('height','200px');
			 }else{
				 $('#main' + mainFlag).css('height','200px');
			 }
			 newChart.clear();
			 newChart.setOption(option01);
			 newChart.resize();
			 $(window).resize(newChart.resize);
		 }
		 if(timeRange == ""){
			 getTaskTypeCodeCounts(project,"",f12,mainFlag);
		 }else{
			 getTaskTypeCodeCounts(project,timeRange,f12,mainFlag);
		 }
		 if(idx == -1){
			 $('.project_pie_wrap_e .taskType').addClass('hidden');
			 $('.project_pie_wrap_e .taskExecute').removeClass('hidden');
			 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap_e .testCaseState').addClass('hidden');
			 $('.project_pie_wrap_e .bugState').addClass('hidden');
		 }else{
			 $('.project_pie_wrap:eq('+idx+') .taskType').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .taskExecute').removeClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .testCaseState').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .bugState').addClass('hidden');
		 }
	 }else if(nameType == "2"){
		 function f13(){
			 if(mainFlag == 0){
				 $('#main').css('height','200px');
			 }else if(mainFlag == -1){
				 $('#main3').css('height','200px');
			 }else{
				 $('#main' + mainFlag).css('height','200px');
			 }
			 newChart.clear();
			 newChart.setOption(option02);
			 newChart.resize();
			 $(window).resize(newChart.resize);
		 }
		 if(timeRange == ""){
			 getExecuteStateCounts(project,"",f13,mainFlag);
		 }else{
			 getExecuteStateCounts(project,timeRange,f13,mainFlag);
		 }
		 if(idx == -1){
			 $('.project_pie_wrap_e .taskType').addClass('hidden');
			 $('.project_pie_wrap_e .taskExecute').addClass('hidden');
			 $('.project_pie_wrap_e .suiteExecute').removeClass('hidden');
			 $('.project_pie_wrap_e .testCaseState').addClass('hidden');
			 $('.project_pie_wrap_e .bugState').addClass('hidden');
		 }else{
			 $('.project_pie_wrap:eq('+idx+') .taskType').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .taskExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .suiteExecute').removeClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .testCaseState').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .bugState').addClass('hidden');
		 }
	 }else if(nameType == "3"){
		 function f14(){
			 if(mainFlag == 0){
				 $('#main').css('height','200px');
			 }else if(mainFlag == -1){
				 $('#main3').css('height','200px');
			 }else{
				 $('#main' + mainFlag).css('height','200px');
			 }
			 newChart.clear();
			 newChart.setOption(option03);
			 newChart.resize();
			$(window).resize(newChart.resize);
			 }
			testCaseStates(project,timeRange,f14,mainFlag);

		if(idx == -1){
			$('.project_pie_wrap_e .taskType').addClass('hidden');
			 $('.project_pie_wrap_e .taskExecute').addClass('hidden');
			 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap_e .testCaseState').removeClass('hidden');
			 $('.project_pie_wrap_e .bugState').addClass('hidden');
		}else{
			 $('.project_pie_wrap:eq('+idx+') .taskType').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .taskExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .testCaseState').removeClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .bugState').addClass('hidden');
		}
	 }else if(nameType == "4"){
		 function f15(){
			 if(mainFlag == 0){
				 $('#main').css('height','260px');
			 }else if(mainFlag == -1){
				 $('#main3').css('height','260px');
			 }else{
				 $('#main' + mainFlag).css('height','260px');
			 }
			 newChart.clear();
			 newChart.setOption(option04);
			 newChart.resize();
			$(window).resize(newChart.resize);
			 }
		 testCaseCondition(project,timeRange,f15,mainFlag);

		if(idx == -1){
			$('.project_pie_wrap_e .taskType').addClass('hidden');
			 $('.project_pie_wrap_e .taskExecute').addClass('hidden');
			 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap_e .testCaseState').addClass('hidden');
			 $('.project_pie_wrap_e .bugState').addClass('hidden');
		}else{
			 $('.project_pie_wrap:eq('+idx+') .taskType').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .taskExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .testCaseState').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .bugState').addClass('hidden');
		}
	 }else if(nameType == "5"){

		 function f16(){
			 if(mainFlag == 0){
				 $('#main').css('height','200px');
			 }else if(mainFlag == -1){
				 $('#main3').css('height','200px');
			 }else{
				 $('#main' + mainFlag).css('height','200px');
			 }
			 newChart.clear();
			 newChart.setOption(option05);
			 newChart.resize();
			 $(window).resize(newChart.resize);
			 }
			bugStates(project,timeRange,f16,mainFlag);

		if(idx == -1){
			$('.project_pie_wrap_e .taskType').addClass('hidden');
			 $('.project_pie_wrap_e .taskExecute').addClass('hidden');
			 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap_e .testCaseState').addClass('hidden');
			 $('.project_pie_wrap_e .bugState').removeClass('hidden');
		}else{
			$('.project_pie_wrap:eq('+idx+') .taskType').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .taskExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .testCaseState').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .bugState').removeClass('hidden');
		}
	 }else if(nameType == "6"){
		 function f17(){
			 if(mainFlag == 0){
				 $('#main').css('height','260px');
			 }else if(mainFlag == -1){
				 $('#main3').css('height','260px');
			 }else{
				 $('#main' + mainFlag).css('height','260px');
			 }
			 newChart.clear();
			 newChart.setOption(option06);
			 newChart.resize();
			 $(window).resize(newChart.resize);
			 }
		 bugCondition(project,timeRange,f17,mainFlag);

		if(idx == -1){
			$('.project_pie_wrap_e .taskType').addClass('hidden');
			 $('.project_pie_wrap_e .taskExecute').addClass('hidden');
			 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap_e .testCaseState').addClass('hidden');
			 $('.project_pie_wrap_e .bugState').addClass('hidden');
		}else{
			$('.project_pie_wrap:eq('+idx+') .taskType').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .taskExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .suiteExecute').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .testCaseState').addClass('hidden');
			 $('.project_pie_wrap:eq('+idx+') .bugState').addClass('hidden');
		}
	 }
	  updMyTestProjectConfig(flag,project,nameType,timeRange);
}

//第四部分：加载饼状图配置数据
 function getMyTestProjectConfig(flag,tag){
		 $.ajax({
			    type : "post",
			    url : '${pageContext.request.contextPath}/home/getMyTestProjectConfig.do',//找到controller里相应的方法
			    success : function(data) {
			    	//判断data是否为空（不为空：根据自定义设置加载图形；为空：默认第一个项目的三种图形，不加时间限制）
			    	if(data != ""){
			    		var str = data.split(',');
				    	var main1 = str[0];
				    	var main2 = str[1];
				    	var main3 = str[2];
				    	var main4 = str[3];

		 		    	var str0 = str[0].split('-');
		 		    	var projectId01 = str0[0];
		 		    	var name1202 = str0[1];
		 		    	var timeRange03 = str0[2];

		 		    	var str1 = str[1].split('-');
		 		    	var projectId11 = str1[0];
		 		    	var name1212 = str1[1];
		 		    	var timeRange13 = str1[2];

		 		    	var str2 = str[2].split('-');
		 		    	var projectId21 = str2[0];
		 		    	var name1222 = str2[1];
		 		    	var timeRange23 = str2[2];

		 		    	var str3 = str[3].split('-');
		 		    	var projectId31 = str3[0];
		 		    	var name1232 = str3[1];
		 		    	var timeRange33 = str3[2];

		 		    	var projectId =$('#project option:eq(0)').attr('value');
		 		    	//tag=0:页面初始化加载饼状图数据；tag=1:模态框数值回显；
		 		    	if(tag == "0"){

//		 		    		var nameType =$('#nameType option:eq(0)').attr('value');
		 		    		//判断第一个模态框是否已经自定义（0为未设置）
			 		    	if(projectId01 == "0"){
		 		    			 function f1(){
		 		    				 myChart.clear();
		 		    				 myChart.setOption(option00);
		 		    				myChart.resize();
		 		    				 $(window).resize(myChart.resize);
		 		    			 }
		 		    			getSuiteCounts(projectId,"",f1,0);
			    				 $('.project_pie_wrap:eq(0) .nameType').text($('#nameType option[value="0"]').text());
			    				 $('.project_pie_wrap:eq(0) .project-timeRange').text($('#project option[value="'+projectId+'"]').text()+"-全部");
			    				 $('.project_pie_wrap:eq(0) .projectId').text(projectId);
			    				 $('.project_pie_wrap:eq(0) .taskType').removeClass('hidden');
			 		    	}else{
			    				 $('.project_pie_wrap:eq(0) .nameType').text($('#nameType option[value="'+name1202+'"]').text());
			    				 $('.project_pie_wrap:eq(0) .project-timeRange').text($('#project option[value="'+projectId01+'"]').text()+"-"
			    						 +$('#timeRange option[value="'+timeRange03+'"]').text());
			    				 $('.project_pie_wrap:eq(0) .projectId').text(projectId01);

			    				//通过判断“类型”下拉框选中的值，加载对应的饼状图
			 		    		if(name1202 == "0"){
					   				 function f11(){
					   					$('#main').css('height','200px');
					   					 myChart.clear();
					   					 myChart.setOption(option00);
					   					myChart.resize();
					   					 $(window).resize(myChart.resize);
					   				 }
					   				 if(timeRange03 == ""){
					   					getSuiteCounts(projectId01,"",f11,0);
					   				 }else{
					   					getSuiteCounts(projectId01,timeRange03,f11,0);
					   				 }

					   				$('.project_pie_wrap:eq(0) .taskType').removeClass('hidden');
					   			 }else if(name1202 == "1"){
					   				 function f12(){
					   					$('#main').css('height','200px');
					   					 myChart.clear();
					   					 myChart.setOption(option01);
					   					myChart.resize();
					   					 $(window).resize(myChart.resize);
					   				 }
					   				 if(timeRange03 == ""){
					   					getTaskTypeCodeCounts(projectId01,"",f12,0);
						   				 }else{
						   					getTaskTypeCodeCounts(projectId01,timeRange03,f12,0);
						   				 }
					   				$('.project_pie_wrap:eq(0) .taskExecute').removeClass('hidden');

					   			 }else if(name1202 == "2"){
					   				 function f13(){
					   					$('#main').css('height','200px');
					   					 myChart.clear();
					   					 myChart.setOption(option02);
					   					myChart.resize();
					   					 $(window).resize(myChart.resize);
					   				 }
					   				 	if(timeRange03 == ""){
					   					getExecuteStateCounts(projectId01,"",f13,0);
						   				 }else{
						   					getExecuteStateCounts(projectId01,timeRange03,f13,0);
						   				 }
					   				$('.project_pie_wrap:eq(0) .suiteExecute').removeClass('hidden');

					   			 }else if(name1202 == "3"){

					   				 function f14(){
					   					$('#main').css('height','200px');
					   					 myChart.clear();
					   					 myChart.setOption(option03);
					   					 myChart.resize();
					   					 $(window).resize(myChart.resize);
					   				 }
					   				testCaseStates(projectId01,timeRange03,f14,0);

					   				$('.project_pie_wrap:eq(0) .testCaseState').removeClass('hidden');

			 		    	}else if(name1202 == "4"){

			 		    		function f15(){
			 		    			$('#main').css('height','260px');
				   					myChart.clear();
				   					myChart.setOption(option04);
					   				myChart.resize();
				   					$(window).resize(myChart.resize);
				   				 }

			   					testCaseCondition(projectId01,timeRange03,f15,0);

	 		    	}else if(name1202 == "5"){
	 		    		 function f16(){
	 		    			$('#main').css('height','200px');
		   					myChart.clear();
		   					 myChart.setOption(option05);
			   					myChart.resize();
		   					$(window).resize(myChart.resize);
			   				 }
			   				bugStates(projectId01,timeRange03,f16,0);

		   				$('.project_pie_wrap:eq(0) .bugState').removeClass('hidden');

	   			 }else if(name1202 == "6"){

	   				function f17(){
	   					$('#main').css('height','260px');
	   					myChart.clear();
	   					myChart.setOption(option06);
	   					myChart.resize();
	   					$(window).resize(myChart.resize);
		   				 }
	   					bugCondition(projectId01,timeRange03,f17,0);
	    			}
		    	}
			 		    	//判断第二个模态框是否已经自定义（0为未设置）
			 		    		if(projectId11 == "0"){
				 		    		 function f2(){
					 		   			 myChart1.clear();
					 		   			 myChart1.setOption(option01);
					 		   			 $(window).resize(myChart1.resize);
				 		   			 }
				 		   			getTaskTypeCodeCounts(projectId,"",f2,1);
				    				 $('.project_pie_wrap:eq(1) .nameType').text($('#nameType option[value="1"]').text());
				    				 $('.project_pie_wrap:eq(1) .project-timeRange').text($('#project option[value="'+projectId+'"]').text()+"-全部");
				    				 $('.project_pie_wrap:eq(1) .projectId').text(projectId);
				    				 $('.project_pie_wrap:eq(1) .taskExecute').removeClass('hidden');

				 		    	}else{
				    				 $('.project_pie_wrap:eq(1) .nameType').text($('#nameType option[value="'+name1212+'"]').text());
				    				 $('.project_pie_wrap:eq(1) .project-timeRange').text($('#project option[value="'+projectId11+'"]').text()+"-"
				    						 +$('#timeRange option[value="'+timeRange13+'"]').text());
				    				 $('.project_pie_wrap:eq(1) .projectId').text(projectId11);
				    				//通过判断“类型”下拉框选中的值，加载对应的饼状图
			 		    			if(name1212 == "0"){
						   				 function f21(){
						   					$('#main1').css('height','200px');
						   					 myChart1.clear();
						   					 myChart1.setOption(option00);
						   					myChart1.resize();
						   					 $(window).resize(myChart1.resize);
						   				 }
						   				if(timeRange13 == ""){
					   					getSuiteCounts(projectId11,"",f21,1);
						   				 }else{
						   					getSuiteCounts(projectId11,timeRange13,f21,1);
						   				 }

						   				$('.project_pie_wrap:eq(1) .taskType').removeClass('hidden');
						   			 }else if(name1212 == "1"){
						   				 function f22(){
						   					$('#main1').css('height','200px');
						   					 myChart1.clear();
						   					 myChart1.setOption(option01);
						   					myChart1.resize();
						   					 $(window).resize(myChart1.resize);
						   				 }
						   				if(timeRange13 == ""){
						   					getTaskTypeCodeCounts(projectId11,"",f22,1);
							   				 }else{
							   					getTaskTypeCodeCounts(projectId11,timeRange13,f22,1);
							   				 }

						   				$('.project_pie_wrap:eq(1) .taskExecute').removeClass('hidden');
						   			 }else if(name1212 == "2"){
						   				 function f23(){
						   					$('#main1').css('height','200px');
						   					 myChart1.clear();
						   					 myChart1.setOption(option02);
						   					myChart1.resize();
						   					 $(window).resize(myChart1.resize);
						   				 }
						   				if(timeRange13 == ""){
						   				 getExecuteStateCounts(projectId11,"",f23,1);
							   				 }else{
							   					 getExecuteStateCounts(projectId11,timeRange13,f23,1);
							   				 }

						   				$('.project_pie_wrap:eq(1) .suiteExecute').removeClass('hidden');
						   			 }else if(name1212 == "3"){


						   				function f24(){
						   					$('#main1').css('height','200px');
						   					myChart1.clear();
						   					 myChart1.setOption(option03);
	 					   					myChart1.resize();
						   					$(window).resize(myChart.resize);
						   				 }
						   				testCaseStates(projectId11,timeRange13,f24,1);


						   					$('.project_pie_wrap:eq(1) .testCaseState').removeClass('hidden');

							 		    	}else if(name1212 == "4"){
							 		    		function f25(){
							 		    			$('#main1').css('height','260px');
								   					myChart1.clear();
								   					myChart1.setOption(option04);
									   				myChart1.resize();
								   					$(window).resize(myChart1.resize);
								   				 }

							   					testCaseCondition(projectId11,timeRange13,f25,1);

							 		    	}else if(name1212 == "5"){

							 		    		function f26(){
							 		    			$('#main1').css('height','200px');
								   					myChart1.clear();
								   					myChart1.setOption(option05);
									   				myChart1.resize();
								   					$(window).resize(myChart1.resize);
								   				 }
								   				bugStates(projectId11,timeRange13,f26,1);

							   					$('.project_pie_wrap:eq(1) .bugState').removeClass('hidden');

							   			 }else if(name1212 == "6"){

							   				function f27(){
							   					$('#main1').css('height','260px');
							   					myChart1.clear();
							   					myChart1.setOption(option06);
							   					myChart1.resize();
							   					$(window).resize(myChart1.resize);
							   				 }
							   				bugCondition(projectId11,timeRange13,f27,1);

							    	}
			 		    		}
			 		    		//判断第三个模态框是否已经自定义（0为未设置）
			 		    		if(projectId21 == "0"){
				 		    		function f3(){
				 		  			 myChart2.clear();
				 		  			 myChart2.setOption(option02);
				 		  			 $(window).resize(myChart2.resize);
				 		  		 	}
				 		  			getExecuteStateCounts(projectId,"",f3,2);
				    				 $('.project_pie_wrap:eq(2) .nameType').text($('#nameType option[value="2"]').text());
				    				 $('.project_pie_wrap:eq(2) .project-timeRange').text($('#project option[value="'+projectId+'"]').text()+"-全部");
				    				 $('.project_pie_wrap:eq(2) .projectId').text(projectId);
				    				 $('.project_pie_wrap:eq(2) .suiteExecute').removeClass('hidden');
				 		    	}else{
				    				 $('.project_pie_wrap:eq(2) .nameType').text($('#nameType option[value="'+name1222+'"]').text());
				    				 $('.project_pie_wrap:eq(2) .project-timeRange').text($('#project option[value="'+projectId21+'"]').text()+"-"
				    						 +$('#timeRange option[value="'+timeRange23+'"]').text());
				    				 $('.project_pie_wrap:eq(2) .projectId').text(projectId21);
				    				//通过判断“类型”下拉框选中的值，加载对应的饼状图
				 		    		 if(name1222 == "0"){
						   				 function f31(){
						   					$('#main2').css('height','200px');
						   					 myChart2.clear();
						   					 myChart2.setOption(option00);
						   					myChart2.resize();
						   					 $(window).resize(myChart2.resize);
						   				 }
						   				if(timeRange23 == ""){
						   					getSuiteCounts(projectId21,"",f31,2);
						   				 }else{
						   					getSuiteCounts(projectId21,timeRange23,f31,2);
						   				 }

						   				$('.project_pie_wrap:eq(2) .taskType').removeClass('hidden');

						   			 }else if(name1222 == "1"){
						   				 function f32(){
						   					$('#main2').css('height','200px');
						   					 myChart2.clear();
						   					 myChart2.setOption(option01);
						   					myChart2.resize();
						   					 $(window).resize(myChart2.resize);
						   				 }
						   				if(timeRange23 == ""){
						   					getTaskTypeCodeCounts(projectId21,"",f32,2);
						   				 }else{
						   					getTaskTypeCodeCounts(projectId21,timeRange23,f32,2);
						   				 }

						   				$('.project_pie_wrap:eq(2) .taskExecute').removeClass('hidden');
						   			 }else if(name1222 == "2"){
						   				 function f33(){
						   					$('#main2').css('height','200px');
						   					 myChart2.clear();
						   					 myChart2.setOption(option02);
						   					myChart2.resize();
						   					 $(window).resize(myChart2.resize);
						   				 }
						   				if(timeRange23 == ""){
						   					getExecuteStateCounts(projectId21,"",f33,2);
						   				 }else{
						   					getExecuteStateCounts(projectId21,timeRange23,f33,2);
						   				 }
						   				$('.project_pie_wrap:eq(2) .suiteExecute').removeClass('hidden');
						   			 }else if(name1222 == "3"){

						   					function f34(){
						   						$('#main2').css('height','200px');
							   					myChart2.clear();
							   					 myChart2.setOption(option03);
		 					   					myChart2.resize();
							   					$(window).resize(myChart2.resize);
							   				 }
							   				testCaseStates(projectId21,timeRange23,f34,2);

						   					$('.project_pie_wrap:eq(2) .testCaseState').removeClass('hidden');

						 		    	}else if(name1222 == "4"){

						 		    		function f35(){
						 		    			$('#main2').css('height','260px');
							   					myChart2.clear();
							   					myChart2.setOption(option04);
								   				myChart2.resize();
							   					$(window).resize(myChart2.resize);
							   				 }
							   				testCaseStates(projectId21,timeRange23,f35,2);

							 		    	}else if(name1222 == "5"){

							 		    		function f36(){
							 		    			$('#main2').css('height','200px');
								   					myChart2.clear();
								   					myChart2.setOption(option05);
									   				myChart2.resize();
								   					$(window).resize(myChart2.resize);
								   				 }
								   				bugStates(projectId21,timeRange23,f36,2);

							   					$('.project_pie_wrap:eq(2) .bugState').removeClass('hidden');

							   			 }else if(name1222 == "6"){

							   				function f37(){
							   					$('#main2').css('height','260px');
							   					myChart2.clear();
							   					myChart2.setOption(option06);
							   					myChart2.resize();
							   					$(window).resize(myChart2.resize);
							   				 }
							   				bugCondition(projectId21,timeRange23,f37,2);

							    	}
				 		    	}
			 		    		//判断第四个模态框是否已经自定义（0为未设置）
			 		    		if("${fn:contains(urlSet, ',home/getMonitorData,')}" != "true"){
			 		    			if(projectId31 == "0"){
			 		    				function f4(){
			 		    					myChart3.clear();
						 		  			 myChart3.setOption(option03);
						 		  			 $(window).resize(myChart3.resize);
					 		  		 	}
					 		  			testCaseStates(projectId,"",f4,-1);
					    				 $('.project_pie_wrap_e .nameType').text($('#nameType option[value="3"]').text());
					    				 $('.project_pie_wrap_e .project-timeRange').text($('#project option[value="'+projectId+'"]').text()+"-全部");
					    				 $('.project_pie_wrap_e .projectId').text(projectId);
										$('.project_pie_wrap_e .testCaseState').removeClass('hidden');
					 		    	}else{
					    				 $('.project_pie_wrap_e .nameType').text($('#nameType option[value="'+name1232+'"]').text());
					    				 $('.project_pie_wrap_e .project-timeRange').text($('#project option[value="'+projectId31+'"]').text()+"-"
					    						 +$('#timeRange option[value="'+timeRange33+'"]').text());
					    				 $('.project_pie_wrap_e .projectId').text(projectId31);
					    				//通过判断“类型”下拉框选中的值，加载对应的饼状图
					 		    		 if(name1232 == "0"){
							   				 function f41(){
							   					$('#main3').css('height','200px');
							   					 myChart3.clear();
							   					 myChart3.setOption(option00);
							   					myChart3.resize();
							   					 $(window).resize(myChart3.resize);
							   				 }
							   				if(timeRange33 == ""){
							   					getSuiteCounts(projectId31,"",f41,-1);
							   				 }else{
							   					getSuiteCounts(projectId21,timeRange23,f41,-1);
							   				 }

							   				$('.project_pie_wrap_e .taskType').removeClass('hidden');

							   			 }else if(name1232 == "1"){
							   				 function f42(){
							   					$('#main3').css('height','200px');
							   					 myChart3.clear();
							   					 myChart3.setOption(option01);
							   					myChart3.resize();
							   					 $(window).resize(myChart3.resize);
							   				 }
							   				if(timeRange33 == ""){
							   					getTaskTypeCodeCounts(projectId31,"",f42,-1);
							   				 }else{
							   					getTaskTypeCodeCounts(projectId31,timeRange33,f42,-1);
							   				 }

							   				$('.project_pie_wrap_e .taskExecute').removeClass('hidden');
							   			 }else if(name1232 == "2"){
							   				 function f43(){
							   					$('#main3').css('height','200px');
							   					 myChart3.clear();
							   					 myChart3.setOption(option02);
							   					myChart3.resize();
							   					 $(window).resize(myChart3.resize);
							   				 }
							   				if(timeRange33 == ""){
							   					getExecuteStateCounts(projectId31,"",f43,-1);
							   				 }else{
							   					getExecuteStateCounts(projectId31,timeRange33,f43,-1);
							   				 }
							   				$('.project_pie_wrap_e .suiteExecute').removeClass('hidden');
							   			 }else if(name1232 == "3"){

							   					function f44(){
							   						$('#main3').css('height','200px');
								   					myChart3.clear();
								   					 myChart3.setOption(option03);
			 					   					myChart3.resize();
								   					$(window).resize(myChart3.resize);
								   				 }
								   				testCaseStates(projectId31,timeRange33,f44,-1);

							   					$('.project_pie_wrap_e .testCaseState').removeClass('hidden');

							 		    	}else if(name1232 == "4"){

							 		    		function f45(){
							 		    			$('#main3').css('height','260px');
								   					myChart3.clear();
								   					myChart3.setOption(option04);
									   				myChart3.resize();
								   					$(window).resize(myChart3.resize);
								   				 }
							 		    		testCaseCondition(projectId31,timeRange33,f45,-1);

								 		    	}else if(name1232 == "5"){

								 		    		function f46(){
								 		    			$('#main3').css('height','200px');
									   					myChart3.clear();
									   					myChart3.setOption(option05);
										   				myChart3.resize();
									   					$(window).resize(myChart3.resize);
									   				 }
									   				bugStates(projectId31,timeRange33,f46,-1);

								   					$('.project_pie_wrap_e .bugState').removeClass('hidden');

								   			 }else if(name1232 == "6"){

								   				function f47(){
								   					$('#main3').css('height','260px');
								   					myChart3.clear();
								   					myChart3.setOption(option06);
								   					myChart3.resize();
								   					$(window).resize(myChart3.resize);
								   				 }
								   				bugCondition(projectId31,timeRange33,f47,-1);

								    	}
					 		    	}
			 		    		 }


		 		    	}else if(tag == "1"){
		 		    		var projectId_ok;
		 		    		var name_ok;
		 		    		var timeRange_ok;
		 		    		if(flag == "main1"){
		 		    			if(projectId01 == "0"){
		 		    				projectId_ok = projectId,
			 		    			name_ok = "0",
			 		    			timeRange_ok="";
		 		    			}else{
		 		    				projectId_ok = projectId01,
			 		    			name_ok = name1202,
			 		    			timeRange_ok=timeRange03;
		 		    			}
		 		    		}else if(flag == "main2"){
		 		    			if(projectId11 == "0"){
		 		    				projectId_ok = projectId,
			 		    			name_ok = "1",
			 		    			timeRange_ok="";
		 		    			}else{
		 		    				projectId_ok = projectId11;
			 		    			name_ok = name1212;
			 		    			timeRange_ok=timeRange13;
		 		    			}
		 		    		}else if(flag == "main3"){
		 		    			if(projectId21 == "0"){
		 		    				projectId_ok = projectId,
			 		    			name_ok = "2",
			 		    			timeRange_ok="";
		 		    			}else{
		 		    				projectId_ok = projectId21;
			 		    			name_ok = name1222;
			 		    			timeRange_ok=timeRange23;
		 		    			}
		 		    		}else if(flag == "main4"){
		 		    			if(projectId31 == "0"){
		 		    				projectId_ok = projectId,
			 		    			name_ok = "3",
			 		    			timeRange_ok="";
		 		    			}else{
		 		    				projectId_ok = projectId31;
			 		    			name_ok = name1232;
			 		    			timeRange_ok=timeRange33;
		 		    			}
		 		    		}
		 		    		$('#project').val(projectId_ok);
	 		    			$('#nameType').val(name_ok);
	 		    			$('#timeRange').val(timeRange_ok);
		 		    	}
			    	}else{
			    		var projectId = '${projectList[0].projectId}';
			    		var projectName = '${projectList[0].projectName}';
			    			 function f1(){
			    				 myChart.clear();
			    				 myChart.setOption(option00);
			    				 newChart.resize();
			    				 $(window).resize(myChart.resize);
			    			 }
			    			 function f2(){
			    				 myChart1.clear();
			    				 myChart1.setOption(option01);
			    				 $(window).resize(myChart1.resize);
			    			 }
			    			 function f3(){
			    				 myChart2.clear();
			    				 myChart2.setOption(option02);
			    				 $(window).resize(myChart2.resize);
			    			 }
//			    			 function f4(){
//			    				 myChart3.clear();
//			    				 myChart3.setOption(option03);
//			    				 $(window).resize(myChart3.resize);
//			    			 }
			    				getSuiteCounts(projectId,"",f1,0);
			    				getTaskTypeCodeCounts(projectId,"",f2,1);
			    				getExecuteStateCounts(projectId,"",f3,2);

			    				if("${fn:contains(urlSet, ',home/getMonitorData,')}" != "true"){
			    					 myChart3.clear();
				    				 myChart3.setOption(option03);
				    				 $(window).resize(myChart3.resize);
			    				}


			    				//todo

								 $('.project_pie_wrap:eq(0) .nameType').text($('#nameType option[value="0"]').text());
			    				 $('.project_pie_wrap:eq(0) .project-timeRange').text(projectName+"-全部");
			    				 $('.project_pie_wrap:eq(0) .projectId').text(projectId);
			    				 $('.project_pie_wrap:eq(0) .taskType').removeClass('hidden');

			    				 $('.project_pie_wrap:eq(1) .nameType').text($('#nameType option[value="1"]').text());
			    				 $('.project_pie_wrap:eq(1) .project-timeRange').text(projectName+"-全部");
			    				 $('.project_pie_wrap:eq(1) .projectId').text(projectId);
			    				 $('.project_pie_wrap:eq(1) .taskExecute').removeClass('hidden');

			    				 $('.project_pie_wrap:eq(2) .nameType').text($('#nameType option[value="2"]').text());
			    				 $('.project_pie_wrap:eq(2) .project-timeRange').text(projectName+"-全部");
			    				 $('.project_pie_wrap:eq(2) .projectId').text(projectId);
			    				 $('.project_pie_wrap:eq(2) .suiteExecute').removeClass('hidden');

			    				 $('.project_pie_wrap_e .nameType').text($('#nameType option[value="3"]').text());
			    				 $('.project_pie_wrap_e .project-timeRange').text(projectName+"-全部");
			    				 $('.project_pie_wrap_e .projectId').text(projectId);
			    				 $('.project_pie_wrap_e .testCaseState').removeClass('hidden');

			    				 $.ajax({
			 					    type : "post",
			 					    url : '${pageContext.request.contextPath}/home/updateMyTestProjectConfig.do',//找到controller里相应的方法
			 					    data : {"newMyTestProjectConfig":"0-0-0,0-0-0,0-0-0,0-0-0"},
			 					    success : function(data) {
			 					    },
			 					    error : function(data) {
//			 					    	layer.alert('操作失败');
			 					    }
			 					   });
			    	}
			    },
			    error : function(data) {
//			    	layer.alert('操作失败');
			    }
			   });
		  }

//跟新自定义配置
 function updMyTestProjectConfig(flag,projectId,name12,timeRange){
	  $.ajax({
		    type : "post",
		    url : '${pageContext.request.contextPath}/home/getMyTestProjectConfig.do',//找到controller里相应的方法
		    success : function(data) {
		    	var str = data.split(',');
		    	var main1 = str[0];
		    	var main2 = str[1];
		    	var main3 = str[2];
		    	var main4 = str[3];
		    	var newMyTestProjectConfig = data;
		    	if(flag == "main1"){
		    		newMyTestProjectConfig = projectId + "-" + name12 + "-" + timeRange + "," +main2 + "," +main3 + "," +main4;
		    	}else if(flag == "main2"){
		    		newMyTestProjectConfig = main1 + "," + projectId + "-" + name12 + "-" + timeRange + "," +main3 + "," +main4;
		    	}else if(flag == "main3"){
		    		newMyTestProjectConfig = main1 + "," + main2 + "," + projectId + "-" + name12 + "-" + timeRange + "," +main4;
		    	}else if(flag == "main4"){
		    		newMyTestProjectConfig = main1 + "," + main2 + "," + main3 + "," + projectId + "-" + name12 + "-" + timeRange;
		    	}

		    	 $.ajax({
					    type : "post",
					    url : '${pageContext.request.contextPath}/home/updateMyTestProjectConfig.do',//找到controller里相应的方法
					    data : {"newMyTestProjectConfig":newMyTestProjectConfig},
					    success : function(data) {
					    },
					    error : function(data) {
//					    	layer.alert('操作失败');
					    }
					   });
		    },
		    error : function(data) {
		    	layer.msg('操作失败 !', {icon: 2});
//		    	layer.alert('操作失败');
		    }
		   });
		  }

//task类型比例数据查询
function getSuiteCounts(projectId,timeRange,fun,mainFlag){
	 $.ajax({
		    type : "post",
		    url : '${pageContext.request.contextPath}/home/getTaskTypeCodeCounts.do',//找到controller里相应的方法
		    data : {"projectId":projectId,"timeRange":timeRange}, //把数组的值赋给data，把上面的param改为data,这里就能直接去掉
		    beforeSend: function(XMLHttpRequest){
		    	if(mainFlag == 0){
		    		myChart.showLoading();
				}else if(mainFlag == -1){
					myChart3.showLoading();
				 }else if(mainFlag == 1){
					 myChart1.showLoading();
				}else if(mainFlag == 2){
					myChart2.showLoading();
				}
        	},
		    success : function(data) {
		    	var str = data.split(',');
		    	var zeroNum = 0;
				var data = [];
		    	for(var i = 0; i < 5; i++){
		    		if(str[i] != "0"){
		    			switch (i)
			    		{
			    		case 0:
			    		  data.push({value:str[0], name:'静态分析'});
			    		  break;
			    		case 1:
			    			data.push({value:str[1], name:'接口测试'});
			    		  break;
			    		case 2:
			    			data.push({value:str[2], name:'功能测试'});
			    		  break;
			    		case 3:
			    			data.push({value:str[3], name:'性能分析'});
			    		  break;
			    		case 4:
			    			data.push({value:str[4], name:'其他'});
			    		  break;
			    		}
		    		}else{
		    			zeroNum += 1;

		    		}
		    	}
		    	option00.series[0].data = data;
		    	fun();

				if(zeroNum == 5){
					if(mainFlag == 0){
						$("#main").addClass('hidden');
						$('.project_pie_wrap:eq('+mainFlag+') .taskType').addClass('hidden');
					}else if(mainFlag == -1){
						 $('#main3').addClass('hidden');
						 $('.project_pie_wrap_e .taskType').addClass('hidden');
					 }else{
						$("#main"+mainFlag).addClass('hidden');
						$('.project_pie_wrap:eq('+mainFlag+') .taskType').addClass('hidden');
					}
					if(mainFlag == -1){
						$(".main03").removeClass('hidden');
					}else{
						$(".main0"+mainFlag).removeClass('hidden');
					}

				}else{
					if(mainFlag == 0){
						$("#main").removeClass('hidden');
					}else if(mainFlag == -1){
						 $('#main3').removeClass('hidden');
					 }else{
						$("#main"+mainFlag).removeClass('hidden');
					}
					if(mainFlag == -1){
						$(".main03").addClass('hidden');
					}else{
						$(".main0"+mainFlag).addClass('hidden');
					}
				}

//		    	 var myChart = echarts.init(document.getElementById('main'));
		    	 if(mainFlag == -1){
		    		 $('.project_pie_wrap_e .jingtai').text(str[0]);
			    	 $('.project_pie_wrap_e .jiekou').text(str[1]);
			    	 $('.project_pie_wrap_e .gongneng').text(str[2]);
			    	 $('.project_pie_wrap_e .xingneng').text(str[3]);
			    	 $('.project_pie_wrap_e .qita').text(str[4]);
		    	 }else{
		    		 $('.project_pie_wrap:eq('+mainFlag+') .jingtai').text(str[0]);
			    	 $('.project_pie_wrap:eq('+mainFlag+') .jiekou').text(str[1]);
			    	 $('.project_pie_wrap:eq('+mainFlag+') .gongneng').text(str[2]);
			    	 $('.project_pie_wrap:eq('+mainFlag+') .xingneng').text(str[3]);
			    	 $('.project_pie_wrap:eq('+mainFlag+') .qita').text(str[4]);
		    	 }
		    },
		    complete: function(XMLHttpRequest, textStatus){
		    	if(mainFlag == 0){
		    		myChart.hideLoading();
				}else if(mainFlag == -1){
					myChart3.hideLoading();
				 }else if(mainFlag == 1){
					 myChart1.hideLoading();
				}else if(mainFlag == 2){
					myChart2.hideLoading();
				}
        	},
		    error : function(data) {
//		    	layer.alert('操作失败');
		    }
		   });
}
//task执行情况数据查询
function getTaskTypeCodeCounts(projectId,timeRange,fun,mainFlag){
	 $.ajax({
		    type : "post",
		    url : '${pageContext.request.contextPath}/home/getExecuteStateCounts.do',//找到controller里相应的方法
		    data : {"projectId":projectId,"timeRange":timeRange}, //把数组的值赋给data，把上面的param改为data,这里就能直接去掉
		    beforeSend: function(XMLHttpRequest){
		    	if(mainFlag == 0){
		    		myChart.showLoading();
				}else if(mainFlag == -1){
					myChart3.showLoading();
				 }else if(mainFlag == 1){
					 myChart1.showLoading();
				}else if(mainFlag == 2){
					myChart2.showLoading();
				}
        	},
		    success : function(data) {
		    	if(data != "" || data != null){
		    		var str = data.split(',');
		    		var zeroNum = 0;
					var data = [];
			    	for(var i = 0; i < 2; i++){
			    		if(str[i] != "0"){
			    			switch (i)
				    		{
				    		case 0:
				    		  data.push({value:str[0], name:'通过'});
				    		  break;
				    		case 1:
				    			data.push({value:str[1], name:'失败'});
				    		  break;

				    		}
			    		}else{
			    			zeroNum += 1;

			    		}
			    	}
			    	option01.series[0].data = data;

			    	if(zeroNum == 2){
						if(mainFlag == 0){
							$("#main").addClass('hidden');
							$('.project_pie_wrap:eq('+mainFlag+') .taskExecute').addClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').addClass('hidden');
							 $('.project_pie_wrap_e .taskExecute').addClass('hidden');
						 }else{
							$("#main"+mainFlag).addClass('hidden');
							$('.project_pie_wrap:eq('+mainFlag+') .taskExecute').addClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").removeClass('hidden');
						}else{
							$(".main0"+mainFlag).removeClass('hidden');
						}

					}else{
						if(mainFlag == 0){
							$("#main").removeClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').removeClass('hidden');
						 }else{
							$("#main"+mainFlag).removeClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").addClass('hidden');
						}else{
							$(".main0"+mainFlag).addClass('hidden');
						}

						fun();
					}
		    	}
		    	 if(mainFlag == -1){
		    		 $('.project_pie_wrap_e .taskExecute-fail').text(str[1]);
			    	 $('.project_pie_wrap_e .taskExecute-success').text(str[0]);
		    	 }else{
		    	 $('.project_pie_wrap:eq('+mainFlag+') .taskExecute-fail').text(str[1]);
		    	 $('.project_pie_wrap:eq('+mainFlag+') .taskExecute-success').text(str[0]);
		    	 }
		    },
		    complete: function(XMLHttpRequest, textStatus){
		    	if(mainFlag == 0){
		    		myChart.hideLoading();
				}else if(mainFlag == -1){
					myChart3.hideLoading();
				 }else if(mainFlag == 1){
					 myChart1.hideLoading();
				}else if(mainFlag == 2){
					myChart2.hideLoading();
				}
        	},
		    error : function(data) {
//		    	layer.alert('操作失败');
		    }
		   });
}

//套件执行结果数据查询
function getExecuteStateCounts(projectId,timeRange,fun,mainFlag){
	 $.ajax({
		    type : "post",
		    url : '${pageContext.request.contextPath}/home/getSuiteCounts.do',//找到controller里相应的方法
		    data : {"projectId":projectId,"timeRange":timeRange}, //把数组的值赋给data，把上面的param改为data,这里就能直接去掉
		    beforeSend: function(XMLHttpRequest){
		    	if(mainFlag == 0){
		    		myChart.showLoading();
				}else if(mainFlag == -1){
					myChart3.showLoading();
				 }else if(mainFlag == 1){
					 myChart1.showLoading();
				}else if(mainFlag == 2){
					myChart2.showLoading();
				}
        	},
		    success : function(data) {
		    	var str = data.split(',');

		    	var zeroNum = 0;
				var data = [];
		    	for(var i = 0; i < 2; i++){

		    		if(str[i] != "0"){
		    			switch (i)
			    		{
			    		case 0:
			    		  data.push({value:str[0], name:'通过'});
			    		  break;
			    		case 1:
			    			data.push({value:str[1]-str[0], name:'失败'});
			    		  break;

			    		}
		    		}else{
		    			zeroNum += 1;

		    		}
		    	}
		    	option02.series[0].data = data;
		    	if(zeroNum == 2){
					if(mainFlag == 0){
						$("#main").addClass('hidden');
						$('.project_pie_wrap:eq('+mainFlag+') .suiteExecute').addClass('hidden');
					}else if(mainFlag == -1){
						 $('#main3').addClass('hidden');
						 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
					 }else{
						$("#main"+mainFlag).addClass('hidden');
						$('.project_pie_wrap:eq('+mainFlag+') .suiteExecute').addClass('hidden');
					}
					if(mainFlag == -1){
						$(".main03").removeClass('hidden');
					}else{
						$(".main0"+mainFlag).removeClass('hidden');
					}

				}else{
					if(mainFlag == 0){
						$("#main").removeClass('hidden');
					}else if(mainFlag == -1){
						 $('#main3').removeClass('hidden');
					 }else{
						$("#main"+mainFlag).removeClass('hidden');
					}
					if(mainFlag == -1){
						$(".main03").addClass('hidden');
					}else{
						$(".main0"+mainFlag).addClass('hidden');
					}

					fun();
				}
		    	if(mainFlag == -1){
		    		$('.project_pie_wrap_e .suiteExecute-success').text(str[0]);
			    	 $('.project_pie_wrap_e .suiteExecute-fail').text(str[1]-str[0]);
		    	}else{
		    	 $('.project_pie_wrap:eq('+mainFlag+') .suiteExecute-success').text(str[0]);
		    	 $('.project_pie_wrap:eq('+mainFlag+') .suiteExecute-fail').text(str[1]-str[0]);
		    	}
		    },
		    complete: function(XMLHttpRequest, textStatus){
		    	if(mainFlag == 0){
		    		myChart.hideLoading();
				}else if(mainFlag == -1){
					myChart3.hideLoading();
				 }else if(mainFlag == 1){
					 myChart1.hideLoading();
				}else if(mainFlag == 2){
					myChart2.hideLoading();
				}
        	},
		    error : function(data) {
//		    	layer.alert('操作失败');
		    }
		   });
	  }

//测试用例状态获取数据
function testCaseStates(projectId,timeRange,fun,mainFlag){
	 $.ajax({
			    type : "post",
			    url : '${pageContext.request.contextPath}/home/getTestCaseAndBugState.do',//找到controller里相应的方法
			    data : {"projectId":projectId,"timeRange":timeRange,"issueType":1},
			    beforeSend: function(XMLHttpRequest){
			    	if(mainFlag == 0){
			    		myChart.showLoading();
					}else if(mainFlag == -1){
						myChart3.showLoading();
					 }else if(mainFlag == 1){
						 myChart1.showLoading();
					}else if(mainFlag == 2){
						myChart2.showLoading();
					}
	         	},
			    success : function(data) {
			    	var data0 = [];
			    	for(var key in data){
	 		    		data0.push({value:data[key], name:key});
			    	}
			    	option03.series[0].data = data0;

			    	var length  = Object.keys(data).length ;

			    	if(length == 0){
						if(mainFlag == 0){
							$("#main").addClass('hidden');
							$('.project_pie_wrap:eq('+mainFlag+') .testCaseState').addClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').addClass('hidden');
							 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
						 }else{
							$("#main"+mainFlag).addClass('hidden');
							$('.project_pie_wrap:eq('+mainFlag+') .testCaseState').addClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").removeClass('hidden');
						}else{
							$(".main0"+mainFlag).removeClass('hidden');
						}
//						 $('.project_pie_wrap_e .suiteExecute').addClass('hidden');
//						 $('.project_pie_wrap:eq('+idx+') .testCaseState').removeClass('hidden');
					}else{
						if(mainFlag == 0){
							$("#main").removeClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').removeClass('hidden');
						 }else{
							$("#main"+mainFlag).removeClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").addClass('hidden');
						}else{
							$(".main0"+mainFlag).addClass('hidden');
						}

						fun();
						if(length == 7 || length == 8){
				    		if(mainFlag == -1){
				    			$(".project_pie_wrap_e .testCaseState").css("padding-left","5%");
				    		}else{
				    			$(".project_pie_wrap:eq("+mainFlag+") .testCaseState").css("padding-left","5%");
				    		}
				    	}else{
				    		if(mainFlag == -1){
				    			$(".project_pie_wrap_e .testCaseState").css("padding-left","0");
				    		}else{
				    			$(".project_pie_wrap:eq("+mainFlag+") .testCaseState").css("padding-left","0");
				    		}

				    	}

				    	var classFlag = "";
				    	if(mainFlag == -1){
				    		classFlag = "project_pie_wrap_e";
				    	}else{
				    		classFlag = "project_pie_wrap:eq("+mainFlag+")";
				    	}
				    	$("." +classFlag+ " .testCaseState").html("");
//	 			    	$(".project_pie_wrap:eq("+mainFlag+") .testCaseState").html("");

				    	var div = "";
				    	if(length == 1){
				    		for(var key in data){
								div += "<div class='col-xs-12 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 2){
				    		for(var key in data){
								div += "<div class='col-xs-6 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 3){
				    		for(var key in data){
								div += "<div class='col-xs-4 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 4){
				    		for(var key in data){
								div += "<div class='col-xs-3 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 5){
				    		div = "<div class='col-xs-1'></div>";
							for(var key in data){
								div += "<div class='col-xs-2 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 6){
							for(var key in data){
								div += "<div class='col-xs-2 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 7){
							for(var key in data){
								div += "<div class='col-xs-1 panel-b4 cm7'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 8){
							for(var key in data){
								div += "<div class='col-xs-1 panel-b4 cm8'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}
				    	$("." +classFlag+ " .testCaseState").append(div);
					}
			    },
			    complete: function(XMLHttpRequest, textStatus){
			    	if(mainFlag == 0){
			    		myChart.hideLoading();
					}else if(mainFlag == -1){
						myChart3.hideLoading();
					 }else if(mainFlag == 1){
						 myChart1.hideLoading();
					}else if(mainFlag == 2){
						myChart2.hideLoading();
					}
	         	},
			    error : function(data) {
//			    	layer.alert('操作失败');
			    }
		   });

}


//缺陷状态获取数据
function bugStates(projectId,timeRange,fun,mainFlag){

	 $.ajax({
			    type : "post",
			    url : '${pageContext.request.contextPath}/home/getTestCaseAndBugState.do',//找到controller里相应的方法
			    data : {"projectId":projectId,"timeRange":timeRange,"issueType":0},
			    beforeSend: function(XMLHttpRequest){
			    	if(mainFlag == 0){
			    		myChart.showLoading();
					}else if(mainFlag == -1){
						myChart3.showLoading();
					 }else if(mainFlag == 1){
						 myChart1.showLoading();
					}else if(mainFlag == 2){
						myChart2.showLoading();
					}
	         	},
			    success : function(data) {
			    	var data0 = [];
			    	for(var key in data){
	 		    		data0.push({value:data[key], name:key});
			    	}
			    	option05.series[0].data = data0;

			    	var length  = Object.keys(data).length ;

			    	if(length == 0){
			    		if(mainFlag == 0){
							$("#main").addClass('hidden');
							$('.project_pie_wrap:eq('+mainFlag+') .bugState').addClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').addClass('hidden');
							 $('.project_pie_wrap_e .bugState').addClass('hidden');
						 }else{
							$("#main"+mainFlag).addClass('hidden');
							$('.project_pie_wrap:eq('+mainFlag+') .bugState').addClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").removeClass('hidden');
						}else{
							$(".main0"+mainFlag).removeClass('hidden');
						}

					}else{
						if(mainFlag == 0){
							$("#main").removeClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').removeClass('hidden');
						 }else{
							$("#main"+mainFlag).removeClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").addClass('hidden');
						}else{
							$(".main0"+mainFlag).addClass('hidden');
						}
						fun();
						if(length == 7 || length == 8){
				    		if(mainFlag == -1){
				    			$(".project_pie_wrap_e .bugState").css("padding-left","5%");
				    		}else{
				    			$(".project_pie_wrap:eq("+mainFlag+") .bugState").css("padding-left","5%");
				    		}
				    	}else{
				    		if(mainFlag == -1){
				    			$(".project_pie_wrap_e .bugState").css("padding-left","0");
				    		}else{
				    			$(".project_pie_wrap:eq("+mainFlag+") .bugState").css("padding-left","0");
				    		}

				    	}

				    	var classFlag = "";
				    	if(mainFlag == -1){
				    		classFlag = "project_pie_wrap_e";
				    	}else{
				    		classFlag = "project_pie_wrap:eq("+mainFlag+")";
				    	}
				    	$("." +classFlag+ " .bugState").html("");
//	 			    	$(".project_pie_wrap:eq("+mainFlag+") .testCaseState").html("");

				    	var div = "";
				    	if(length == 1){
				    		for(var key in data){
								div += "<div class='col-xs-12 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 2){
				    		for(var key in data){
								div += "<div class='col-xs-6 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 3){
				    		for(var key in data){
								div += "<div class='col-xs-4 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 4){
				    		for(var key in data){
								div += "<div class='col-xs-3 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 5){
				    		div = "<div class='col-xs-1'></div>";
							for(var key in data){
								div += "<div class='col-xs-2 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 6){
							for(var key in data){
								div += "<div class='col-xs-2 panel-b4'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 7){
							for(var key in data){
								div += "<div class='col-xs-1 panel-b4 cm7'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}else if(length == 8){
							for(var key in data){
								div += "<div class='col-xs-1 panel-b4 cm8'><div>"
									+key+"</div><h5><span>"
									+ data[key]+"</span></h5></div>";
							}
				    	}
				    	$("." +classFlag+ " .bugState").append(div);

					}

			    },
			    complete: function(XMLHttpRequest, textStatus){
			    	if(mainFlag == 0){
			    		myChart.hideLoading();
					}else if(mainFlag == -1){
						myChart3.hideLoading();
					 }else if(mainFlag == 1){
						 myChart1.hideLoading();
					}else if(mainFlag == 2){
						myChart2.hideLoading();
					}
	         	},
			    error : function(data) {
//			    	layer.alert('操作失败');
			    }
		   });

}

//测试用例情况获取数据
function testCaseCondition(projectId,timeRange,fun,mainFlag){

	 $.ajax({
			    type : "post",
			    url : '${pageContext.request.contextPath}/home/getTestCaseCondition.do',//找到controller里相应的方法
			    data : {"projectId":projectId,"timeRange":timeRange,"issueType":1},
			    beforeSend: function(XMLHttpRequest){
			    	if(mainFlag == 0){
			    		myChart.showLoading();
					}else if(mainFlag == -1){
						myChart3.showLoading();
					 }else if(mainFlag == 1){
						 myChart1.showLoading();
					}else if(mainFlag == 2){
						myChart2.showLoading();
					}
	         	},
			    success : function(data) {
			    	var dataTime = [];
			    	var dataValue = [];
			    	var length  = Object.keys(data).length ;
			    	if(length == 0){
			    		if(mainFlag == 0){
							$("#main").addClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').addClass('hidden');
						 }else{
							$("#main"+mainFlag).addClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").removeClass('hidden');
						}else{
							$(".main0"+mainFlag).removeClass('hidden');
						}
					}else{
						if(mainFlag == 0){
							$("#main").removeClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').removeClass('hidden');
						 }else{
							$("#main"+mainFlag).removeClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").addClass('hidden');
						}else{
							$(".main0"+mainFlag).addClass('hidden');
						}

						for(var key in data){
				    		dataTime.push(key.substring(5));
				    		dataValue.push(data[key]);
				    	}
						var interval = parseInt(length/10);
						option04.xAxis.axisLabel.interval = interval;
						option04.dataZoom.startValue = dataTime[0];
				    	option04.xAxis.data = dataTime;
				    	option04.series[0].data = dataValue;
						fun();
					}
			    },
			    complete: function(XMLHttpRequest, textStatus){
			    	if(mainFlag == 0){
			    		myChart.hideLoading();
					}else if(mainFlag == -1){
						myChart3.hideLoading();
					 }else if(mainFlag == 1){
						 myChart1.hideLoading();
					}else if(mainFlag == 2){
						myChart2.hideLoading();
					}
	         	},
			    error : function(data) {
//			    	layer.alert('操作失败');
			    }
		   });

}

//测试用例情况获取数据
function bugCondition(projectId,timeRange,fun,mainFlag){
	 $.ajax({
			    type : "post",
			    url : '${pageContext.request.contextPath}/home/getBugCondition.do',//找到controller里相应的方法
			    data : {"projectId":projectId,"timeRange":timeRange},
			    beforeSend: function(XMLHttpRequest){
			    	if(mainFlag == 0){
			    		myChart.showLoading();
					}else if(mainFlag == -1){
						myChart3.showLoading();
					 }else if(mainFlag == 1){
						 myChart1.showLoading();
					}else if(mainFlag == 2){
						myChart2.showLoading();
					}
	         	},
			    success : function(data) {
			    	var dataTime = [];
			    	var dataValue0 = [];
			    	var dataValue1 = [];
			    	var dataValue2 = [];
			    	var dataValue3 = [];
			    	var dataValue4 = [];

					var length  = Object.keys(data).length ;

			    	if(length == 0){
			    		if(mainFlag == 0){
							$("#main").addClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').addClass('hidden');
						 }else{
							$("#main"+mainFlag).addClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").removeClass('hidden');
						}else{
							$(".main0"+mainFlag).removeClass('hidden');
						}
					}else{
						if(mainFlag == 0){
							$("#main").removeClass('hidden');
						}else if(mainFlag == -1){
							 $('#main3').removeClass('hidden');
						 }else{
							$("#main"+mainFlag).removeClass('hidden');
						}
						if(mainFlag == -1){
							$(".main03").addClass('hidden');
						}else{
							$(".main0"+mainFlag).addClass('hidden');
						}

						for(var key in data){
				    		dataTime.push(key.substring(5));
				    		dataValue0.push(data[key][0]);
				    		dataValue1.push(data[key][1]);
				    		dataValue2.push(data[key][2]);
				    		dataValue3.push(data[key][3]);
				    		dataValue4.push(data[key][4]);
				    	}
						var interval = parseInt(length/10);

						option06.xAxis.axisLabel.interval = interval;
						option06.dataZoom.startValue = dataTime[0];
				    	option06.xAxis.data = dataTime;
				    	option06.series[0].data = dataValue0;
				    	option06.series[1].data = dataValue1;
				    	option06.series[2].data = dataValue2;
				    	option06.series[3].data = dataValue3;
				    	option06.series[4].data = dataValue4;

				    	fun();
					}


			    },
			    complete: function(XMLHttpRequest, textStatus){
			    	if(mainFlag == 0){
			    		myChart.hideLoading();
					}else if(mainFlag == -1){
						myChart3.hideLoading();
					 }else if(mainFlag == 1){
						 myChart1.hideLoading();
					}else if(mainFlag == 2){
						myChart2.hideLoading();
					}
	         	},
			    error : function(data) {
//			    	layer.alert('操作失败');
			    }
		   });

}

//服务器监控获取数据
function getMonitorData(){
	 $.ajax({
		    type : "post",
		    url : '${pageContext.request.contextPath}/home/getMonitorData.do',//找到controller里相应的方法
		    beforeSend: function(XMLHttpRequest){
		    	 if("${fn:contains(urlSet, ',home/getMonitorData,')}" == "true"){
		    		 ipMonitorLoadding.showLoading();
		    	 }
//		    	$("#ipMonitor .spiner-example").css("display","block");
               //ShowLoading();

        	},
		    success : function(data) {
// 		    	console.log(JSON.stringify(data));
		    	$("#ipMonitor").html("");
				var div = "";

				var length  = Object.keys(data).length ;
				if(length != 0){
					for(var key in data){

			    			//linux-windows
							//#8bc34a-#f59d1a-#bb2044
							var color1="#8bc34a";
							var color2="#8bc34a";
							var color3="#8bc34a";
							if(parseInt(data[key][0]) >= parseInt("80%") && parseInt(data[key][0]) < parseInt("90%")){
								color1 = "#f59d1a";
							}else if(parseInt(data[key][0]) >= parseInt("90%") && parseInt(data[key][0]) <= parseInt("100%")){
								color1 = "#bb2044";
							}
							if(parseInt(data[key][1]) >= parseInt("80%") && parseInt(data[key][1]) < parseInt("90%")){
								color2 = "#f59d1a";
							}else if(parseInt(data[key][1]) >= parseInt("90%") && parseInt(data[key][1]) <= parseInt("100%")){
								color2 = "#bb2044";
							}
							if(parseInt(data[key][2]) >= parseInt("80%") && parseInt(data[key][2]) < parseInt("90%")){
								color3 = "#f59d1a";
							}else if(parseInt(data[key][2]) >= parseInt("90%") && parseInt(data[key][2]) <= parseInt("100%")){
								color3 = "#bb2044";
							}
			    			if(data[key][3] == "0"){
			    				div += "<div class='row panel-e01 clickJump'>"
									+"<div class='col-sm-2 panel-e011'><i class='fa fa-linux'></i></div>"
									+"<div class='col-sm-10 panel-e012'>"
									+"<h4>" + key + "</h4>"
									+"<span class='station hidden'>" + data[key][5] + "</span>" +"<div class='col-sm-4'><span class='panel-e0120' style='background-color: "+color1+";'> cpu:"
						    		+ data[key][0] +"</span></div><div class='col-sm-4'><span class='panel-e0120' style='background-color: "+color2+";'>内存:"
						    		+ data[key][1] +"</span></div><div class='col-sm-4'><span class='panel-e0120' style='background-color: "+color3+";'>硬盘:"
						    		+ data[key][2] +"</span></div></div></div>";
			    			}else if(data[key][3] == "1"){
			    				div += "<div class='row panel-e01 clickJump'>"
									+"<div class='col-sm-2 panel-e011'><i class='fa fa-windows'></i></div>"
									+"<div class='col-sm-10 panel-e012'>"
									+"<h4>" + key + "</h4>"
									+"<span class='station hidden'>" + data[key][5] + "</span>" +"<div class='col-sm-4'><span class='panel-e0120' style='background-color: "+color1+";'> cpu:"
						    		+ data[key][0] +"</span></div><div class='col-sm-4'><span class='panel-e0120' style='background-color: "+color2+";'>内存:"
						    		+ data[key][1] +"</span></div><div class='col-sm-4'><span class='panel-e0120' style='background-color: "+color3+";'>硬盘:"
						    		+ data[key][2] +"</span></div></div></div>";
			    			}


			    	}

				}else{
					div = "<div class='ipMonitor' >无数据</div>";
				}

		    	$("#ipMonitor").append(div);
		    },
		    complete: function(XMLHttpRequest, textStatus){
		    	 if("${fn:contains(urlSet, ',home/getMonitorData,')}" == "true"){
		    		 ipMonitorLoadding.hideLoading();
		    	 }

        	},
		    error : function(data) {
//		    	layer.alert('操作失败');
		    }
		   });
	  }

window.setInterval(getMonitorData,300000);
</script>
</body>
</html>